webfox / laravel-xero-oauth2

A Laravel integration for Xero using the Oauth 2.0 spec
MIT License
50 stars 32 forks source link

Error 500 when adding additional scopes #6

Closed derrickleemy closed 4 years ago

derrickleemy commented 4 years ago

Hey there,

The default scopes openid email profile offline_access works fine. However, when I try to add new scopes openid email profile offline_access accounting.transactions accounting.settings.read, I start getting Status Error 500.

Any ideas?

hailwood commented 4 years ago

Hey @derrickleemy,

Can I please see your xero.php config file?

Those scopes should work correctly, in fact in our apps we tend to use a superset of those -

'openid',
'email',
'profile',
'offline_access',
'accounting.settings.read',
'accounting.transactions',
'accounting.contacts',
'accounting.attachments'

Does the error page give you any more details e.g. if you have a typo on a scope name you'll get something like

image

A similar error would be shown if your client id or similar was invalid, but give you've stated the default scopes work, I don't believe that to be your issue.

derrickleemy commented 4 years ago

Doesn't seem to fix the problem. I do get a similar screen but without the second error line which explains what is happening

hailwood commented 4 years ago

Hmm the fact you've got no error message is very strange (that page is created/hosted by Xero).

Are you able to provide me with the url when that error appears?

hailwood commented 4 years ago

Closing due to inactivity.

kunallibra commented 4 years ago

hi I am having the same error [Error: 500]

My scopes in the authorised are: $options = [ 'scope' => ['openid email profile offline_access accounting.settings.read accounting.transactions accounting.contacts accounting.attachments'] ];

and in the config file:

'scopes' => [ 'openid', 'email', 'profile', 'offline_access', 'accounting.settings.read', 'accounting.transactions', 'accounting.contacts', 'accounting.attachments' ],

It is exactly the same. Dont know why am getting this error.

Notice: Undefined index: oauth2state in /Applications/XAMPP/xamppfiles/htdocs/project/callback.php on line 24 Invalid StateInvalid state