Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #97 from okta/Vilsafur-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bretterer committed Mar 1, 2022
2 parents 432570d + d6160e9 commit 5444e57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Adaptors/FirebasePhpJwt.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Carbon\Carbon;
use Firebase\JWT\JWT as FirebaseJWT;
use Illuminate\Cache\ArrayStore;
use Firebase\JWT\Key;
use Okta\JwtVerifier\Jwt;
use Okta\JwtVerifier\Request;
use UnexpectedValueException;
Expand Down Expand Up @@ -71,8 +72,10 @@ public function getKeys(string $jku): array

public function decode($jwt, $keys): Jwt
{
FirebaseJWT::$leeway = $this->leeway;
$decoded = (array)FirebaseJWT::decode($jwt, $keys, ['RS256']);
$keys = array_map(function ($key) {
return new Key($key, 'RS256');
}, $keys);
$decoded = (array)FirebaseJWT::decode($jwt, $keys);
return (new Jwt($jwt, $decoded));
}

Expand Down

0 comments on commit 5444e57

Please sign in to comment.