Bcarbs avatar image
Bcarbs asked

Why am I receiving invalid_scope_data error?

The scope data list you provided is invalid for your request&error=invalid_scope_data


Receiving the error invalid_scope_data when trying to request an authorization for LWA. Scope data field pasted above... Any idea what I might be missing or which fields are invalid?

login with amazondash replenishment service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks Bcarbs, I forwarded this to the Dash team, will post back when I have an answer. Thanks!

1 Like 1 ·

Hey Levon, just wanted to include this bit of information in the event it helps the Dash team!{"scope_data":{"dash:replenish":{"device_model":"eb9edf13-5a38-4d72-b7e5-37a788e144bf","serial":"arduino123456789"}},"scope":"dash:replenish","response_type":"code"}&response_type=code&redirect_uri=

This url sort of worked, it seems the fact that my details were form-url-encoded in the body was causing the error. Including the scope_data json in the same format with all fields in plain text like the above managed to get me as far as the "grant permission to the app page.

Unfortunately though, once I choose to grant permission I receive a response that there was an error, but it's pretty vague...

It's actually the same exact error/response that Daniel is having here (Authorization request with scope=dash:replenish)

Thanks for all your help!

0 Likes 0 ·

Thanks for additional details, I have added them to the ticket. Will reply as soon as I hear back from the DRS team. Thanks!

1 Like 1 ·

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi Bcarbs,

The main problem seems to be that you are making a malformed request. Here is how a valid request to LWA should look like:


Note, values such as e.g scope, scope_data etc. should be URLEncoded. So you should be calling URL looking like this:


Hope it helps.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Trying to similarly resolve the invalid scope issue....I get redirected but with error message in redirect URL.

If I change the second dash%3Areplenish with dash_replenish, it responds with error in scope data list as other people have mentioned, rather than the invalid scope error.

Any ideas?

0 Likes 0 ·

Hi Tyeth,

The correct scope is 'dash:replenish'. The other one, 'dash_replenish' is not a valid scope and will result in invalid scope error.

Regarding the request:≻ope=dash%3Areplenish≻ope_data=%7B%22dash%3Areplenish%22%3A%7B%22device_model%22%3A%22WCPAPER002%22%2C%22serial%22%3A%22wcpaper002001%22%7D%7D&response_type=code&

Looks like some of the fields above (scope and scope_data) are not encoded correctly. Is it just a copy paste error? Once we have the correct request, we can forward it to LwA to take a look. Thanks!

0 Likes 0 ·