Skip to content

Commit

Permalink
Alter default scope separator for Xero connect requests
Browse files Browse the repository at this point in the history
The default oauth league scope separator is a comma, however Xero
requires spaces instead. When passing an array of scopes, the underlying
league code will implode the scope array automatically. But this will be
rejected via Xero due to the comma. Use a space instead.

@see https://github.com/calcinai/oauth2-xero#authorization-code-flow
@see https://developer.xero.com/documentation/oauth2/sign-in

Scopes are the permissions that your app is requesting approval for.
You can pass in a list of scopes separated by a space.

Remove extra space, new line
  • Loading branch information
kylehqcom committed Apr 26, 2021
1 parent e5feb87 commit 7712a3a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Provider/Xero.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ protected function getDefaultScopes()
return ['openid email profile'];
}

/**
* Returns the string that should be used to separate scopes when building
* the URL for requesting an access token.
*
* @return string Scope separator, defaults to ' '
*/
protected function getScopeSeparator()
{
return ' ';
}

/**
* Generates a resource owner object from a successful resource owner
* details request.
Expand Down

0 comments on commit 7712a3a

Please sign in to comment.