From 7712a3a5da29ea7329c1908d11c5ee716d8b5675 Mon Sep 17 00:00:00 2001 From: Kyle Clarke Date: Mon, 26 Apr 2021 12:29:29 -0500 Subject: [PATCH] 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 --- src/Provider/Xero.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Provider/Xero.php b/src/Provider/Xero.php index 03af79b..e7e3d72 100644 --- a/src/Provider/Xero.php +++ b/src/Provider/Xero.php @@ -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.