Skip to content

Commit

Permalink
Fix reading JWT in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
SidneyAllen committed Feb 14, 2020
1 parent 9dfd9c6 commit 4c7132a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@
'code' => $_GET['code']
]);

$jwt = new XeroAPI\XeroPHP\JWTClaims(
$accessToken->getValues()["id_token"]
);

$jwt->decode();
echo $jwt->getGivenName();
$jwt = new XeroAPI\XeroPHP\JWTClaims();
$jwt->setTokenId($accessToken->getValues()["id_token"]);
$jwt->decode();
echo $jwt->getGivenName();

$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( (string)$accessToken->getToken() );
$config->setHost("https://api.xero.com");
Expand Down

0 comments on commit 4c7132a

Please sign in to comment.