Skip to content

Commit

Permalink
Merge pull request #334 from XeroAPI/xero-php-2.24.0
Browse files Browse the repository at this point in the history
Update for JWT decode
  • Loading branch information
pumpkinball authored Oct 19, 2023
2 parents d6c8d2b + 67bb7f9 commit 12cfc1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ext-mbstring": "*",
"guzzlehttp/guzzle": "^6.2 | ^7.0",
"league/oauth2-client": "^2.5.0",
"firebase/php-jwt": "^5.0 | ^6.0"
"firebase/php-jwt": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
Expand Down
4 changes: 2 additions & 2 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = '[xero-php-oauth2 (2.23.0)]';
protected $userAgent = '[xero-php-oauth2 (2.23.1)]';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -697,7 +697,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 2.38.0' . PHP_EOL;
$report .= ' SDK Package Version: 2.23.0' . PHP_EOL;
$report .= ' SDK Package Version: 2.23.1' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
2 changes: 1 addition & 1 deletion lib/JWTClaims.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class JWTClaims
private function verify($token) {
$json = file_get_contents('https://identity.xero.com/.well-known/openid-configuration/jwks');
$jwks = json_decode($json, true);
$supportedAlgorithm = array('RS256');
$supportedAlgorithm = (object) ['alg'=>['RS256','ES256']];
$verifiedJWT = JWT::decode($token, JWK::parseKeySet($jwks), $supportedAlgorithm);

return $verifiedJWT;
Expand Down

0 comments on commit 12cfc1e

Please sign in to comment.