test_openid_connect 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/omniauth/strategies/test_openid_connect.rb +14 -16
- data/test_openid_connect.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9411261ba29e4fcbf9f47bd7f38c7a66cbb3089496837d7b3686d1d1ab1ea2d
|
4
|
+
data.tar.gz: 49ee1c3f569623cb7ea231899e0d23d15854370dbccf690f6d55a07f3e6ecfef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3ad45715e4aabf3241f8068a6b3850e10b223917a2dcb2ca36cbb404c5dad340af35b274b9d355d01188fa199c71a183e7768e2a35fddc2cd2356ef84c77313
|
7
|
+
data.tar.gz: 3cb9fb4b65ab2e07b8e1554ad7429925e1493a2dc26f4a9bcd70dcdb0962370f77dac82b231b5863bd80f10c26ee7bf8b316bc21f1f75530f43262b29b0c01a1
|
data/Gemfile.lock
CHANGED
@@ -13,9 +13,9 @@ module ::OmniAuth
|
|
13
13
|
option :scope, "openid"
|
14
14
|
option :discovery, true
|
15
15
|
option :use_userinfo, true
|
16
|
-
option :cache, lambda { |key, &blk| blk.call } # Default no-op cache
|
17
|
-
option :error_handler, lambda { |error, message| nil } # Default no-op handler
|
18
|
-
option :verbose_logger, lambda { |message| nil } # Default no-op handler
|
16
|
+
# option :cache, lambda { |key, &blk| blk.call } # Default no-op cache
|
17
|
+
# option :error_handler, lambda { |error, message| nil } # Default no-op handler
|
18
|
+
# option :verbose_logger, lambda { |message| nil } # Default no-op handler
|
19
19
|
option :passthrough_authorize_options, [:p]
|
20
20
|
option :passthrough_token_options, [:p]
|
21
21
|
|
@@ -27,16 +27,14 @@ module ::OmniAuth
|
|
27
27
|
userinfo_endpoint: nil,
|
28
28
|
auth_scheme: :basic_auth
|
29
29
|
|
30
|
-
def verbose_log(message)
|
31
|
-
|
32
|
-
end
|
30
|
+
# def verbose_log(message)
|
31
|
+
# options.verbose_logger.call(message)
|
32
|
+
# end
|
33
33
|
|
34
34
|
def discover!
|
35
|
-
verbose_log("Fetching discovery document from #{options[:client_options][:discovery_document]}")
|
36
|
-
discovery_document =
|
37
|
-
|
38
|
-
end
|
39
|
-
verbose_log("Discovery document loaded\n\n#{discovery_document.to_yaml}")
|
35
|
+
# verbose_log("Fetching discovery document from #{options[:client_options][:discovery_document]}")
|
36
|
+
discovery_document = client.request(:get, options[:client_options][:discovery_document], parse: :json).parsed
|
37
|
+
# verbose_log("Discovery document loaded\n\n#{discovery_document.to_yaml}")
|
40
38
|
|
41
39
|
discovery_params = {
|
42
40
|
authorize_url: "authorization_endpoint",
|
@@ -89,8 +87,8 @@ module ::OmniAuth
|
|
89
87
|
end
|
90
88
|
|
91
89
|
def callback_phase
|
92
|
-
if request.params["error"] && request.params["error_description"]
|
93
|
-
verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
|
90
|
+
if request.params["error"] && request.params["error_description"]
|
91
|
+
# verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
|
94
92
|
return redirect(response)
|
95
93
|
end
|
96
94
|
|
@@ -117,7 +115,7 @@ module ::OmniAuth
|
|
117
115
|
# token was acquired via a direct server-server connection to the issuer
|
118
116
|
@id_token_info ||= begin
|
119
117
|
decoded = JWT.decode(access_token['id_token'], nil, false).first
|
120
|
-
verbose_log("Loaded JWT\n\n#{decoded.to_yaml}")
|
118
|
+
# verbose_log("Loaded JWT\n\n#{decoded.to_yaml}")
|
121
119
|
JWT::Verify.verify_claims(decoded,
|
122
120
|
verify_iss: true,
|
123
121
|
iss: options[:client_options][:site],
|
@@ -129,7 +127,7 @@ module ::OmniAuth
|
|
129
127
|
verify_iat: false,
|
130
128
|
verify_jti: false
|
131
129
|
)
|
132
|
-
verbose_log("Verified JWT\n\n#{decoded.to_yaml}")
|
130
|
+
# verbose_log("Verified JWT\n\n#{decoded.to_yaml}")
|
133
131
|
|
134
132
|
decoded
|
135
133
|
end
|
@@ -138,7 +136,7 @@ module ::OmniAuth
|
|
138
136
|
def userinfo_response
|
139
137
|
@raw_info ||= begin
|
140
138
|
info = access_token.get(options[:client_options][:userinfo_endpoint]).parsed
|
141
|
-
verbose_log("Fetched userinfo response\n\n#{info.to_yaml}")
|
139
|
+
# verbose_log("Fetched userinfo response\n\n#{info.to_yaml}")
|
142
140
|
info
|
143
141
|
end
|
144
142
|
|
data/test_openid_connect.gemspec
CHANGED