oa-openid 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,7 +45,10 @@ module OmniAuth
45
45
  end
46
46
 
47
47
  def request_phase
48
- return fail!(:missing_information) unless identifier
48
+ identifier ? start : get_identifier
49
+ end
50
+
51
+ def start
49
52
  openid = Rack::OpenID.new(dummy_app, @store)
50
53
  response = openid.call(env)
51
54
  case env['rack.openid.response']
@@ -56,11 +59,23 @@ module OmniAuth
56
59
  end
57
60
  end
58
61
 
62
+ def get_identifier
63
+ response = app.call(env)
64
+ if response[0] < 400
65
+ response
66
+ else
67
+ OmniAuth::Form.build('OpenID Authentication') do
68
+ text_field('OpenID Identifier', 'identifier')
69
+ end.to_response
70
+ end
71
+ end
72
+
59
73
  def callback_phase
74
+ env['REQUEST_METHOD'] = 'GET'
75
+
60
76
  openid = Rack::OpenID.new(lambda{|env| [200,{},[]]}, @store)
61
77
  openid.call(env)
62
78
  resp = env.delete('rack.openid.response')
63
-
64
79
  case resp.status
65
80
  when :failure
66
81
  fail!(:invalid_credentials)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Bleigh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-29 00:00:00 -04:00
17
+ date: 2010-05-01 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency