File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 2020
2121use Firebase \JWT \ExpiredException as ExpiredExceptionV3 ;
2222use Firebase \JWT \SignatureInvalidException ;
23+ use Firebase \JWT \Key ;
2324use GuzzleHttp \Client ;
2425use GuzzleHttp \ClientInterface ;
2526use InvalidArgumentException ;
@@ -99,11 +100,15 @@ public function verifyIdToken($idToken, $audience = null)
99100 $ certs = $ this ->getFederatedSignOnCerts ();
100101 foreach ($ certs as $ cert ) {
101102 try {
102- $ payload = $ this ->jwt ->decode (
103- $ idToken ,
104- $ this ->getPublicKey ($ cert ),
105- array ('RS256 ' )
106- );
103+ $ args = [$ idToken ];
104+ $ publicKey = $ this ->getPublicKey ($ cert );
105+ if (class_exists (Key::class)) {
106+ $ args [] = new Key ($ publicKey , 'RS256 ' );
107+ } else {
108+ $ args [] = $ publicKey ;
109+ $ args [] = ['RS256 ' ];
110+ }
111+ $ payload = \call_user_func_array ([$ this ->jwt , 'decode ' ], $ args );
107112
108113 if (property_exists ($ payload , 'aud ' )) {
109114 if ($ audience && $ payload ->aud != $ audience ) {
You can’t perform that action at this time.
0 commit comments