Skip to content

Commit 7712a3a

Browse files
committed
Alter default scope separator for Xero connect requests
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
1 parent e5feb87 commit 7712a3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Provider/Xero.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ protected function getDefaultScopes()
145145
return ['openid email profile'];
146146
}
147147

148+
/**
149+
* Returns the string that should be used to separate scopes when building
150+
* the URL for requesting an access token.
151+
*
152+
* @return string Scope separator, defaults to ' '
153+
*/
154+
protected function getScopeSeparator()
155+
{
156+
return ' ';
157+
}
158+
148159
/**
149160
* Generates a resource owner object from a successful resource owner
150161
* details request.

0 commit comments

Comments
 (0)