REST app - Getting an 'invalid scope' error with authorization URL

justin_lawler
Contributor
Contributor

I'm testing a sandbox REST app, have generated an authorization URL with the app client_id & secret, and have pasted it into the browser, but the browser is giving an 'invalid scope' error.

 

Screen Shot 2017-08-25 at 16.53.40.png

The 'scope' portion of the URL looks like:

 

scope=openid+profile+https%3A%2F%2Furi.paypal.com%2Fservices%2Finvoicing

Any suggestions?

 

I saw one similar question, but the answer given there is not clear:

https://github.com/paypal/PayPal-Android-SDK/issues/310

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Justin
Moderator
Moderator
Hi,

Can you provide an example request / response so I can review it in detail ? If you don't want to share it here, you can submit a ticket via our support portal - https://www.paypal.com/mts

Was my post helpful? If so, please give me a kudos!

View solution in original post

Login to Me Too
7 REPLIES 7

MTS_Justin
Moderator
Moderator
Hi @justin_lawler

Can you please provide the step-by-step instructions to reproduce the issue, so I can attempt from my side ?

Was my post helpful? If so, please give me a kudos!
Login to Me Too

justin_lawler
Contributor
Contributor

Hi, thanks for your reply.

 

I'm using the code from the PHP SDK example:

I am using the sandbox app 'Thursday App' associated with this app.

 

Note: it works with the scope 'openid' and ''https://uri.paypal.com/services/invoicing', but if I add anything else it fails from the authentication site on PayPal - with above error.

 

Thanks and regards,

Justin

Login to Me Too

MTS_Justin
Moderator
Moderator
Hello,

Check the attributes for your REST app, to ensure you have enabled login with paypal and that you have enabled the correct scope attributes, which allow you to request the specific account information for the "profile" scope value

Was my post helpful? If so, please give me a kudos!
Login to Me Too

justin_lawler
Contributor
Contributor

Thanks - missed that! Got the 'profiles' working now.

 

But now I can't get it working for 'payments'

 

Using the example here:

 

I've looked through all the PayPal app settings & turned everything on.

 

The scopes I'm using to generate the authentication URL are below. Note I wasn't able to get it working for 'paldetails' or 'expresscheckout'.

'openid',
'profile',
'address',
'email',
'phone',
'https://uri.paypal.com/services/paypalattributes',
//'https://uri.paypal.com/services/expresscheckout',
'https://uri.paypal.com/services/invoicing',
//'https://uri.paypal.com/services/paldetails'

Login to Me Too

MTS_Justin
Moderator
Moderator
Hello,

What error do you receive now ?

Can you provide an example which I can review ?

Was my post helpful? If so, please give me a kudos!
Login to Me Too

justin_lawler
Contributor
Contributor

Hi,

 

it's the same error as in the original message in this chain. An 'invalid scope' error.

 

I've checked on every setting I can find on the app side. I can't find any further settings.

 

Is it a limitation of sandbox apps?

 

Thanks and regards,

Justin

Login to Me Too
Solved

MTS_Justin
Moderator
Moderator
Hi,

Can you provide an example request / response so I can review it in detail ? If you don't want to share it here, you can submit a ticket via our support portal - https://www.paypal.com/mts

Was my post helpful? If so, please give me a kudos!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.