omniauth-delegated-authentication 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module DelegatedAuthentication
3
- VERSION = "0.1"
3
+ VERSION = "0.2"
4
4
  end
5
5
  end
@@ -27,12 +27,16 @@ module OmniAuth
27
27
  end
28
28
 
29
29
  def callback_phase
30
- if request.params['error'] || request.params['error_reason']
31
- raise CallbackError.new(request.params['error'], request.params['error_description'] || request.params['error_reason'], request.params['error_uri'])
30
+ if request.params['action'] == "cancel"
31
+ raise CallbackError.new(request.params['action'], request.params['ResponseCode'])
32
32
  end
33
33
 
34
34
  self.consent_token = process_consent_token
35
35
  self.consent_token = client.refreshConsentToken(self.consent_token) unless consent_token.isValid?
36
+
37
+ super
38
+ rescue CallbackError => e
39
+ fail!(:invalid_credentials, e)
36
40
  end
37
41
 
38
42
  protected
@@ -45,10 +49,9 @@ module OmniAuth
45
49
  class CallbackError < StandardError
46
50
  attr_accessor :error, :error_reason, :error_uri
47
51
 
48
- def initialize(error, error_reason=nil, error_uri=nil)
52
+ def initialize(error, error_reason=nil)
49
53
  self.error = error
50
54
  self.error_reason = error_reason
51
- self.error_uri = error_uri
52
55
  end
53
56
  end
54
57
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'omniauth-delegated-authentication'
3
- s.version = '0.1'
3
+ s.version = '0.2'
4
4
  s.date = '2013-01-29'
5
5
  s.summary = "Delegated Authentication protocol developer strategy for Omniauth"
6
6
  s.description = s.summary
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-delegated-authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -20,7 +20,6 @@ files:
20
20
  - lib/omniauth-delegated-authentication.rb
21
21
  - lib/omniauth-delegated-authentication/version.rb
22
22
  - lib/omniauth/strategies/omniauth-delegated-authentication.rb
23
- - omniauth-delegated-authentication-0.1.gem
24
23
  - omniauth-delegated-authentication.gemspec
25
24
  homepage: http://rubygems.org/gems/omniauth-delegated-authentication
26
25
  licenses: []