Skip to content

Custom connections are broken due to league/oauth2-client change (invalid_scope error) #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hailwood opened this issue Feb 4, 2025 · 1 comment

Comments

@hailwood
Copy link

hailwood commented Feb 4, 2025

The oauth2-client package made a change in 2.8.0 to send across scopes by default.

This means when you attempt to call ->getAccessToken('client_credentials'); it's now asking for the scopes openid email profile due to them being the default scopes set on the Xero provider.

To fix this issue we need to either pass through the actual list of scopes we use ['scope' => 'accounting.transactions accounting.contacts ...'] as the second parameter to the ->getAccessToken call, or override the Providers getDefaultScopes method to return an empty array.

There is currently an open PR to fix the issue thephpleague/oauth2-client#1053
However, I am leaving this here to assist others in debugging, or suggest that this package should pin the version of oauth2-client to 2.7 until this fix is released.

I understand that this issue is probably better suited for calcinai/oauth2-xero, but users are unlikely to actually look there so figure having it here will lower your support requests.

@calcinai
Copy link
Owner

calcinai commented Feb 4, 2025

Hopefully it gets fixed upstream, and yeah, also happy to pin to an older version in the interim over at oauth2-xero. Thanks for digging into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants