omniauth-dice 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 154d96bc38ba5c4c2dfe1a7facf22892ce61ae26
4
- data.tar.gz: 45e25aea48dd2454a1bf0720e8859b360e09c141
3
+ metadata.gz: b5b9be999c98d047041bd0ea7f9dc2e155971838
4
+ data.tar.gz: 859a4cb50fa183cb687af337b040c41e9b83d14d
5
5
  SHA512:
6
- metadata.gz: 9b876975f32c4b617ddf876371876ad3265671658b41807d00d3d6295e5ee3907b1eba5c18747929936bef112c55104034c1dd41cb706f457fc70c97c6b21d44
7
- data.tar.gz: 111cd2f06332c91b1eb18230e6a650c03e358b9063add3754015c028faadd7f7467a1d10eb406acf316ffee440d0a587d193574a71dc642d4bfb6ba89f7622ff
6
+ metadata.gz: d9a80350574e4f83156c9c051c7c41b110d9847a3d2170239d7a950d28aa1e334c2506e2f29ff8cc8dbd42d2f1ffd4726408358485700f84c74b408c0116be79
7
+ data.tar.gz: 488acf3620615cf66e72431bff942f7bc1dc79b02a09ddec73e44a544bf431b14a14c189902f0cfe63a3f98e8c0dcbebb13022fb153c7f02e8648f649479e902
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Dice
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.9'
4
4
  end
5
5
  end
@@ -82,20 +82,11 @@ module OmniAuth
82
82
  log :debug, "Formatted issuer_dn: #{issuer_dn}"
83
83
  set_session_dn(issuer_dn, 'issuer') if issuer_dn
84
84
 
85
- redirect callback_url
85
+ redirect callback_path
86
86
  end
87
87
 
88
88
  def callback_phase
89
- issuer_dn = env['omniauth.params']['issuer_dn']
90
- if issuer_dn
91
- response = connection.get query_url, { issuerDN: issuer_dn }
92
- else
93
- response = connection.get query_url
94
- end
95
- if !response || response.status.to_i >= 400
96
- log :error, response.inspect
97
- return fail!(:invalid_credentials)
98
- end
89
+ response = authenticate_user
99
90
  @raw_data = response.body
100
91
  @data = parse_response_data
101
92
  session['omniauth.auth'] ||= auth_hash
@@ -148,6 +139,21 @@ module OmniAuth
148
139
  tmp_hash
149
140
  end
150
141
 
142
+ def authenticate_user
143
+ issuer_dn = env['omniauth.params']['issuer_dn']
144
+ if issuer_dn
145
+ response = connection.get query_url, { issuerDN: issuer_dn }
146
+ else
147
+ response = connection.get query_url
148
+ end
149
+ if !response || response.status.to_i >= 400
150
+ log :error, response.inspect
151
+ return fail!(:invalid_credentials)
152
+ end
153
+
154
+ response
155
+ end
156
+
151
157
  # Default ['omniauth.auth']['info'] field names
152
158
  def info_defaults
153
159
  [:dn, :email, :firstName, :lastName, :fullName, :citizenshipStatus,
@@ -94,7 +94,7 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
94
94
  expect(last_request.url).to eq('http://example.org/auth/dice')
95
95
  expect(last_request.env['rack.session']['omniauth.params']['user_dn']).to eq(user_dn.to_s)
96
96
  expect(last_request.env['rack.session']['omniauth.params']['issuer_dn']).to eq(issuer_dn)
97
- expect(last_response.location).to eq('http://example.org/auth/dice/callback')
97
+ expect(last_response.location).to eq('/auth/dice/callback')
98
98
  end
99
99
 
100
100
  it "should set the client's DN (from header)" do
@@ -104,7 +104,7 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
104
104
  expect(last_request.url).to eq('http://example.org/auth/dice')
105
105
  expect(last_request.env['rack.session']['omniauth.params']['user_dn']).to eq(user_dn.to_s)
106
106
  expect(last_request.env['rack.session']['omniauth.params']['issuer_dn']).to be_nil
107
- expect(last_response.location).to eq('http://example.org/auth/dice/callback')
107
+ expect(last_response.location).to eq('/auth/dice/callback')
108
108
  end
109
109
 
110
110
  it "should set the issuer's DN (from header)" do
@@ -114,7 +114,7 @@ describe OmniAuth::Strategies::Dice, type: :strategy do
114
114
  expect(last_request.env['HTTP_SSL_CLIENT_I_DN']).to eq(raw_issuer_dn)
115
115
  expect(last_request.url).to eq('http://example.org/auth/dice')
116
116
  expect(last_request.env['rack.session']['omniauth.params']['issuer_dn']).to eq(issuer_dn)
117
- expect(last_response.location).to eq('http://example.org/auth/dice/callback')
117
+ expect(last_response.location).to eq('/auth/dice/callback')
118
118
  end
119
119
  end
120
120
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-dice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Haddox
@@ -30,7 +30,7 @@ cert_chain:
30
30
  42qdwEXvvkODZAD6KAIXPdmbMfBgPbcd+B/4eUA0PyKo+4dgL1NuqX4MPWToevIZ
31
31
  O8EKLF2X7NmC6FY1bOsSj/J8r1SOkx0rxgF+geRvY1P+hfNjDfxTsjU=
32
32
  -----END CERTIFICATE-----
33
- date: 2015-02-12 00:00:00.000000000 Z
33
+ date: 2015-02-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: awesome_print
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
407
407
  version: '0'
408
408
  requirements: []
409
409
  rubyforge_project:
410
- rubygems_version: 2.4.4
410
+ rubygems_version: 2.2.2
411
411
  signing_key:
412
412
  specification_version: 4
413
413
  summary: DN Interoperable Conversion Expert Strategy
metadata.gz.sig CHANGED
Binary file