Skip to content

Commit

Permalink
Merge pull request #14 from XeroAPI/sid-development
Browse files Browse the repository at this point in the history
Fix reading JWT in callback
  • Loading branch information
SidneyAllen authored Feb 14, 2020
2 parents 1404f68 + 4c7132a commit 0b2f5dd
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 0b2f5dd

Please sign in to comment.