question

vikramezhil avatar image
vikramezhil asked

Authentication using amazon beta sdk for "Alexa Voice Service"

I am currently having a hard time to determine what needs to be passed in the scope data for [b]PRODUCT_ID[/b], [b]PRODUCT_DSN[/b] and [b]CODE_CHALLENGE[/b] which are required string variables that needs to be set in the bundle before authorizing the authentication manager. [Ref - https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/authorizing-your-alexa-enabled-product-from-an-android-or-ios-mobile-app ] If anyone can point me in the correct direction, it would be very helpful as I am completely new to the Alexa environment.
alexa voice 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.

Joshua Frank avatar image
Joshua Frank answered
Has anyone figured this out yet? I have been searching for this information for hours. PRODUCT_ID ??? PRODUCT_DSN ??? CODE_CHALLENGE ??? Does anyone from Amazon monitor this forum?
10 |5000

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

vikramezhil avatar image
vikramezhil answered
I am yet to get a solution for this, one thing I found out though is for the [b]CODE_CHALLENGE[/b] we need to generate a base64 url coding which can be done using the method given at - http://tools.ietf.org/html/draft-ietf-oauth-spop-10#appendix-A . The above is just a guess from my side, still waiting for someone to provide some clarity regarding the [b]PRODUCT_ID[/b] & [b]PRODUCT_DSN[/b] variables that needs to be passed in the scope data. Fingers crossed.
10 |5000

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

Joshua Frank avatar image
Joshua Frank answered
So PRODUCT_ID is your app name PRODUCT_DSN is a serial number or id you can just make it up. Product ID = 'AlexaLink' Product DSN = '1234' for testing purposes. Did you figure out what APP_SCOPE should be? I tried new String[]{"profile"} but get the following error: AuthError cat= INTERNAL type=ERROR_SERVER_REPSONSE - com.amazon.identity.auth.device.AuthError: Error=invalid_scope error_description=An unknown scope was requested Oh I just read your stackoverflow answer. http://stackoverflow.com/questions/31798899/how-to-authenticate-with-alexa-voice-service-from-android I guess you think the APP_SCOPE is not the issue. If I get any further I will let you know.
10 |5000

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

idris-s avatar image
idris-s answered
10 |5000

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

Joshua Frank avatar image
Joshua Frank answered
"alexa:all" got me a little further Now the Login with Amazon site comes up. I can login. Then click "I agree". Then it takes me to a page that says: We're sorry! An error occurred when we tried to process your request. Rest assured, we're already working on the problem and expect to resolve it shortly. Has anyone got this working yet? I would hate to put all this time into something that is not possible.
10 |5000

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

idris-s avatar image
idris-s answered
I would make sure the "PRODUCT_ID" exactly matches the "ID" on AVS Developer Portal. https://developer.amazon.com/edw/home.html#/avs/list
10 |5000

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

tymarc avatar image
tymarc answered
What is the [b]code challenge [/b] that we need to put? Where do we get the [b]code verifier[/b]?
10 |5000

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

tymarc avatar image
tymarc answered
Found it finally: It's the Client Secret from the Security Profile
10 |5000

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

Joshua Frank avatar image
Joshua Frank answered
Now I'm stuck on Step 7. I keep getting { "error_description": "Malformed request", "error": "invalid_request" } Is code_verifier from step 7 the same as CODE_CHALLENGE from step 5? Which would be the Client Secret from the Security Profile.
10 |5000

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

callmerockyli avatar image
callmerockyli answered
Can anyone describe how APP_SCOPE should be construct specifically? I see "alexa:all" is a part of string scope_data. But authorize() take String[] as the first parameter. Thank you
10 |5000

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