diff --git a/src/Provider/Azure.php b/src/Provider/Azure.php index b928282..269426b 100644 --- a/src/Provider/Azure.php +++ b/src/Provider/Azure.php @@ -339,7 +339,7 @@ public function getLogoutUrl($post_logout_redirect_uri = "") public function validateAccessToken($accessToken) { $keys = $this->getJwtVerificationKeys(); - $tokenClaims = (array)JWT::decode($accessToken, $keys, ['RS256']); + $tokenClaims = (array)JWT::decode($accessToken, $keys); $this->validateTokenClaims($tokenClaims); diff --git a/src/Token/AccessToken.php b/src/Token/AccessToken.php index 7de80f9..a268c20 100644 --- a/src/Token/AccessToken.php +++ b/src/Token/AccessToken.php @@ -3,9 +3,8 @@ namespace TheNetworg\OAuth2\Client\Token; use Firebase\JWT\JWT; -use InvalidArgumentException; -use League\OAuth2\Client\Tool\RequestFactory; use RuntimeException; +use TheNetworg\OAuth2\Client\Provider\Azure; class AccessToken extends \League\OAuth2\Client\Token\AccessToken { @@ -13,6 +12,9 @@ class AccessToken extends \League\OAuth2\Client\Token\AccessToken protected $idTokenClaims; + /** + * @param Azure $provider + */ public function __construct(array $options, $provider) { parent::__construct($options); @@ -27,7 +29,7 @@ public function __construct(array $options, $provider) $tks = explode('.', $this->idToken); // Check if the id_token contains signature if (3 == count($tks) && !empty($tks[2])) { - $idTokenClaims = (array)JWT::decode($this->idToken, $keys, ['RS256']); + $idTokenClaims = (array)JWT::decode($this->idToken, $keys); } else { // The id_token is unsigned (coming from v1.0 endpoint) - https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx