openid_connect 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -2
- data/VERSION +1 -1
- data/lib/openid_connect/client.rb +5 -5
- data/lib/openid_connect/response_object/id_token.rb +1 -1
- data/spec/openid_connect/client_spec.rb +2 -2
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openid_connect (0.0.
|
4
|
+
openid_connect (0.0.30)
|
5
5
|
activemodel (>= 3)
|
6
6
|
attr_required (>= 0.0.3)
|
7
7
|
json (>= 1.4.3)
|
@@ -32,7 +32,6 @@ GEM
|
|
32
32
|
jruby-openssl (0.7.4)
|
33
33
|
bouncy-castle-java
|
34
34
|
json (1.6.1)
|
35
|
-
json (1.6.1-java)
|
36
35
|
json-jwt (0.0.3)
|
37
36
|
json (>= 1.4.3)
|
38
37
|
url_safe_base64
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.31
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module OpenIDConnect
|
2
2
|
class Client < Rack::OAuth2::Client
|
3
|
-
attr_optional :
|
3
|
+
attr_optional :check_id_endpoint, :user_info_endpoint
|
4
4
|
|
5
5
|
def initialize(attributes = {})
|
6
6
|
super
|
7
|
-
@user_info_endpoint
|
8
|
-
@
|
7
|
+
@user_info_endpoint ||= '/user_info'
|
8
|
+
@check_id_endpoint ||= '/id_token'
|
9
9
|
end
|
10
10
|
|
11
11
|
def authorization_uri(params = {})
|
@@ -14,8 +14,8 @@ module OpenIDConnect
|
|
14
14
|
super
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
absolute_uri_for
|
17
|
+
def check_id_uri
|
18
|
+
absolute_uri_for check_id_endpoint
|
19
19
|
end
|
20
20
|
|
21
21
|
def user_info_uri
|
@@ -34,7 +34,7 @@ module OpenIDConnect
|
|
34
34
|
attributes = case key_or_client
|
35
35
|
when Client
|
36
36
|
resource_request do
|
37
|
-
http_client.post key_or_client.
|
37
|
+
http_client.post key_or_client.check_id_uri, :id_token => jwt_string
|
38
38
|
end
|
39
39
|
else
|
40
40
|
JSON::JWT.decode(jwt_string, key_or_client).with_indifferent_access
|
@@ -19,12 +19,12 @@ describe OpenIDConnect::Client do
|
|
19
19
|
end
|
20
20
|
its(:authorization_uri) { should include 'https://server.example.com/oauth2/authorize' }
|
21
21
|
its(:authorization_uri) { should include 'scope=openid' }
|
22
|
-
its(:
|
22
|
+
its(:check_id_uri) { should == 'https://server.example.com/id_token' }
|
23
23
|
its(:user_info_uri) { should == 'https://server.example.com/user_info' }
|
24
24
|
end
|
25
25
|
|
26
26
|
context 'otherwise' do
|
27
|
-
[:authorization_uri, :
|
27
|
+
[:authorization_uri, :check_id_uri, :user_info_uri].each do |endpoint|
|
28
28
|
describe endpoint do
|
29
29
|
it do
|
30
30
|
expect { client.send endpoint }.should raise_error 'No Host Info'
|