question

Milind Gupta avatar image
Milind Gupta asked

Invalid scope Error

Hi, I am trying to authenticate to the cloud drive API using OAuth2. The scope string query parameter in the URL is: scope=clouddrive%3Awrite+clouddrive%3Aread_all The response that I get is: http://localhost/?error_description=lwa-invalid-parameter-bad-scope&state=1449953115&error=invalid_scope My security profile is already whitelisted. If the scope is clouddrive%3Awrite only then it works. My Questions and comments: Why is the write and read_all scope invalid? Would the write scope allow reading as well? The Getting started example here: https://developer.amazon.com/public/apis/experience/cloud-drive/content/restful-api-getting-started uses both write and read_all scope in the example.
amazon drive
10 |5000

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

Sandeep S. avatar image
Sandeep S. answered
Make sure that the items are separated by SPACE (and not '+' as you have specified). The following works fine... https://www.amazon.com/ap/oa?client_id=XXXXX&scope=clouddrive%3Aread_all%20clouddrive%3Awrite&response_type=code&redirect_uri=https://localhost i.e., "scope=clouddrive:read_all clouddrive:write"
10 |5000

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

Milind Gupta avatar image
Milind Gupta answered
The + was added by the url encoding, I had space before. The problem I found was the wrong HTTP method due to the default being used by my socket library. Thanks
10 |5000

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