question

Sainath avatar image
Sainath asked

Error: failed to fetch user profile

Getting error after completing setup of DRS

request for authorization

https://www.amazon.com/ap/oa?client_id=amzn1.application-oa2-client.64bcab89c5ae47cd83d8e7ccab301855&scope=dash%3Areplenish&scope_data=%7B%22dash%3Areplenish%22%3A%7B%22device_model%22%3A%2276da0a04-91de-4b0a-94b1-6eb6d33d9cb4%22%2C%22serial%22%3A%22arduino123456789%22%2C%22is_test_device%22%3Atrue%7D%7D&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Famazon%2Fcallback

response after completing DRS

URL:http://localhost:3000/auth/amazon/callback?code=ANzAvpIicsityrrREMvX&scope=dash%3Areplenish

InternalOAuthError: failed to fetch user profile

at C:\Users\*************\node_modules\passport-amazon\lib\strategy.js:74:28 at passBackControl (C:\Users\*************\node_modules\oauth\lib\oauth2.js:123:9)

at IncomingMessage.<anonymous> (C:\Users\*************\\node_modules\oauth\lib\oauth2.js:143:7) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

Is it necessary to fetch User details ? Can i skip this step?

dash 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.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi Sainath,

Thanks for posting! It's not entirely clear, but from your question it looks like your were able to get back an authorization code from LWA for the dash:replenish scope, which is sufficient to use DRS. It looks like some failure may have occurred in getting a token for the user profile, but that's only relevant if you wanted to get the customer name, zip code, etc. It is not required for DRS. 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.