omniauth-apple 1.3.0.alpha → 1.3.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/apple/version.rb +1 -1
- data/lib/omniauth/strategies/apple.rb +18 -13
- 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: ccdbe86490c5f075471da1d840b32d7cf2d8fff5269f69e28b8a1f3bd2fc181e
|
4
|
+
data.tar.gz: '08e94e6b4c9e87ae72d1e0e311c389a920dead7925a9ffe7debb128c71fd7024'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 200b3f18382054a6571771f4f5f6856192d5df2b185f8f4af2848d25ecde5411f0e91177f5b418e92db1c229b4fe90af54e83ece8aee2f8820af3225c2ff534d
|
7
|
+
data.tar.gz: 9440a958201d0506cc153ded2a1d9ed82819611c4beae85eb80b96ec9624a99838866445bb217dd88a4062c674c8348511341cc8e2d7d6be3ec64476a2917a3c
|
@@ -77,20 +77,27 @@ module OmniAuth
|
|
77
77
|
@id_info ||= if request.params&.key?('id_token') || access_token&.params&.key?('id_token')
|
78
78
|
id_token_str = request.params['id_token'] || access_token.params['id_token']
|
79
79
|
id_token = JSON::JWT.decode(id_token_str, :skip_verification)
|
80
|
-
|
81
|
-
|
82
|
-
verify_claims!(id_token)
|
83
|
-
id_token
|
84
|
-
else
|
85
|
-
{}
|
86
|
-
end
|
80
|
+
verify_id_token! id_token
|
81
|
+
id_token
|
87
82
|
end
|
88
83
|
end
|
89
84
|
|
90
|
-
def
|
85
|
+
def verify_id_token!(id_token)
|
86
|
+
jwk = fetch_jwk! id_token.kid
|
87
|
+
verify_signature! id_token, jwk
|
88
|
+
verify_claims! id_token
|
89
|
+
end
|
90
|
+
|
91
|
+
def fetch_jwk!(kid)
|
91
92
|
JSON::JWK::Set::Fetcher.fetch File.join(ISSUER, 'auth/keys'), kid: kid
|
92
|
-
rescue
|
93
|
-
|
93
|
+
rescue => e
|
94
|
+
raise CallbackError.new(:jwks_fetching_failed, e)
|
95
|
+
end
|
96
|
+
|
97
|
+
def verify_signature!(id_token, jwk)
|
98
|
+
id_token.verify! jwk
|
99
|
+
rescue => e
|
100
|
+
raise CallbackError.new(:id_token_signature_invalid, e)
|
94
101
|
end
|
95
102
|
|
96
103
|
def verify_claims!(id_token)
|
@@ -122,9 +129,7 @@ module OmniAuth
|
|
122
129
|
end
|
123
130
|
|
124
131
|
def invalid_claim!(claim)
|
125
|
-
|
126
|
-
message = "#{claim} invalid"
|
127
|
-
fail! key, CallbackError.new(key, message)
|
132
|
+
raise CallbackError.new(:id_token_claims_invalid, "#{claim} invalid")
|
128
133
|
end
|
129
134
|
|
130
135
|
def client_id
|