openid_connect 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -3
- data/VERSION +1 -1
- data/lib/openid_connect.rb +33 -0
- data/lib/openid_connect/response_object/id_token.rb +1 -1
- 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.17)
|
5
5
|
activemodel (>= 3)
|
6
6
|
attr_required (>= 0.0.3)
|
7
7
|
json (>= 1.4.3)
|
@@ -25,7 +25,6 @@ GEM
|
|
25
25
|
addressable (2.2.6)
|
26
26
|
attr_required (0.0.3)
|
27
27
|
bcrypt-ruby (3.0.0)
|
28
|
-
bcrypt-ruby (3.0.0-java)
|
29
28
|
bouncy-castle-java (1.5.0146.1)
|
30
29
|
builder (3.0.0)
|
31
30
|
crack (0.1.8)
|
@@ -35,7 +34,6 @@ GEM
|
|
35
34
|
jruby-openssl (0.7.4)
|
36
35
|
bouncy-castle-java
|
37
36
|
json (1.5.4)
|
38
|
-
json (1.5.4-java)
|
39
37
|
jwt (0.1.3)
|
40
38
|
json (>= 1.2.4)
|
41
39
|
mail (2.3.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.18
|
data/lib/openid_connect.rb
CHANGED
@@ -1,7 +1,40 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'logger'
|
2
3
|
require 'rack/oauth2'
|
3
4
|
require 'rack/oauth2/server/id_token_response'
|
4
5
|
|
6
|
+
module OpenIDConnect
|
7
|
+
def self.logger
|
8
|
+
@@logger
|
9
|
+
end
|
10
|
+
def self.logger=(logger)
|
11
|
+
@@logger = logger
|
12
|
+
end
|
13
|
+
self.logger = Logger.new(STDOUT)
|
14
|
+
self.logger.progname = 'OpenIDConnect'
|
15
|
+
|
16
|
+
def self.debugging?
|
17
|
+
@@debugging
|
18
|
+
end
|
19
|
+
def self.debugging=(boolean)
|
20
|
+
@@debugging = boolean
|
21
|
+
end
|
22
|
+
def self.debug!
|
23
|
+
Rack::OAuth2.debugging = true
|
24
|
+
self.debugging = true
|
25
|
+
end
|
26
|
+
def self.debug(&block)
|
27
|
+
rack_oauth2_original = Rack::OAuth2.debugging?
|
28
|
+
original = self.debugging?
|
29
|
+
debug!
|
30
|
+
yield
|
31
|
+
ensure
|
32
|
+
Rack::OAuth2.debugging = rack_oauth2_original
|
33
|
+
self.debugging = original
|
34
|
+
end
|
35
|
+
self.debugging = false
|
36
|
+
end
|
37
|
+
|
5
38
|
require 'openid_connect/exception'
|
6
39
|
require 'openid_connect/client'
|
7
40
|
require 'openid_connect/access_token'
|
@@ -33,7 +33,7 @@ module OpenIDConnect
|
|
33
33
|
HTTPClient.new.post key_or_client.check_session_uri, :id_token => jwt_string
|
34
34
|
end
|
35
35
|
else
|
36
|
-
JWT.decode(jwt_string,
|
36
|
+
JWT.decode(jwt_string, key_or_client).with_indifferent_access
|
37
37
|
end
|
38
38
|
new attributes
|
39
39
|
end
|