Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/Token/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TheNetworg\OAuth2\Client\Token;

use Firebase\JWT\ExpiredException;
use Firebase\JWT\JWT;
use InvalidArgumentException;
use League\OAuth2\Client\Tool\RequestFactory;
Expand Down Expand Up @@ -37,13 +38,16 @@ public function __construct(array $options, $provider)
// Then parse the idToken claims only without validating the signature
$idTokenClaims = (array)JWT::jsonDecode(JWT::urlsafeB64Decode($tks[1]));
}
} catch (JWT_Exception $e) {

$provider->validateTokenClaims($idTokenClaims);
$this->idTokenClaims = $idTokenClaims;

} catch (ExpiredException $e) {
// ID token expired, but whatever ...

} catch (UnexpectedValueException $e) {
throw new RuntimeException('Unable to parse the id_token!');
}

$provider->validateTokenClaims($idTokenClaims);

$this->idTokenClaims = $idTokenClaims;
}
}

Expand Down