XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
87 stars 64 forks source link

Oauth refresh token problems. #333

Closed Fearofthedark66 closed 9 months ago

Fearofthedark66 commented 9 months ago

Hi,

I am having trouble to refresh my tokens and I must be missing something here. With the code below I am getting a : ### Required parameter not passed: "refresh_token" error.

 $provider = new \League\OAuth2\Client\Provider\GenericProvider([
      'clientId'                => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX',   
      'clientSecret'            => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
      'urlAuthorize'            => 'https://login.xero.com/identity/connect/authorize',
      'urlAccessToken'          => 'https://identity.xero.com/connect/token',
      'urlResourceOwnerDetails' => 'https://identity.xero.com/resources'
    ]);
$refreshToken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX';

$newAccessToken = $provider->getAccessToken('authorizaton_code', [
  'refresh_token' =>  $refreshToken,
  'grant_type' => 'authorization_code'
]);

`

github-actions[bot] commented 9 months ago

PETOSS-354

github-actions[bot] commented 9 months ago

Thanks for raising an issue, a ticket has been created to track your request

Fearofthedark66 commented 9 months ago

Never mind, there was a typo from my side :)