Skip to content

Commit

Permalink
Merge pull request #189 from 10n/master
Browse files Browse the repository at this point in the history
  • Loading branch information
hajekj authored Jun 16, 2023
2 parents 7c0f784 + baa36d5 commit 9231c7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Provider/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 5 additions & 3 deletions src/Token/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
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
{
protected $idToken;

protected $idTokenClaims;

/**
* @param Azure $provider
*/
public function __construct(array $options, $provider)
{
parent::__construct($options);
Expand All @@ -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

Expand Down

0 comments on commit 9231c7b

Please sign in to comment.