Skip to content

Commit 12cfc1e

Browse files
authored
Merge pull request #334 from XeroAPI/xero-php-2.24.0
Update for JWT decode
2 parents d6c8d2b + 67bb7f9 commit 12cfc1e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ext-mbstring": "*",
2525
"guzzlehttp/guzzle": "^6.2 | ^7.0",
2626
"league/oauth2-client": "^2.5.0",
27-
"firebase/php-jwt": "^5.0 | ^6.0"
27+
"firebase/php-jwt": "^6.0"
2828
},
2929
"require-dev": {
3030
"phpunit/phpunit": "^4.8",

lib/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Configuration
157157
*
158158
* @var string
159159
*/
160-
protected $userAgent = '[xero-php-oauth2 (2.23.0)]';
160+
protected $userAgent = '[xero-php-oauth2 (2.23.1)]';
161161

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

703703
return $report;

lib/JWTClaims.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class JWTClaims
3636
private function verify($token) {
3737
$json = file_get_contents('https://identity.xero.com/.well-known/openid-configuration/jwks');
3838
$jwks = json_decode($json, true);
39-
$supportedAlgorithm = array('RS256');
39+
$supportedAlgorithm = (object) ['alg'=>['RS256','ES256']];
4040
$verifiedJWT = JWT::decode($token, JWK::parseKeySet($jwks), $supportedAlgorithm);
4141

4242
return $verifiedJWT;

0 commit comments

Comments
 (0)