question

spikereloaded avatar image
spikereloaded asked

Alexa account linking with oauth 1 service

I'm working on a skill that links to a service that uses OAuth 1 (specifically Etsy). I've managed to get the oauth side of things running on my own website, which has an SSL certificate so I'm able to use it. But i'm unclear on the specifics of the login flow related to the Alexa app.

I have linked to a login page on my own website, where the user needs to click a link to take them to the etsy login, which will then authenticate their credentials. however when attempting to click the link, it does nothing and progresses no further. I've tried linking directly to the page that creates the login url then redirects to etsy to login, however this presents me with a blank page. Am i getting the flow completely wrong here and missing a step?

Currently the user

clicks link account on the alexa app -> my website with a button to click - >they click the button -> oauth process begins and url generated - > redirects to etsy to login -> user logs in and is returned to my site - > pass all needed bits back to alexa.

clearly i'm new to ASK and Oauth and my problem is quite specific but hopefully someone can point me in the right direction.

thanks

alexa skills kitskillaccount linkingecho
10 |3000 characters needed characters left characters exceeded

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

WangChao@Amazon avatar image
WangChao@Amazon answered

Hello,

Account Linking requires OAuth 2.0 authorization framework. And please update your login page with instructions at https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system#h3_login_req. Thanks.

1 comment
10 |3000 characters needed characters left characters exceeded

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

Thanks for your reply. I am aware of the need to integrate with the 2.0 framework, and have been using this video here as a reference https://developer.amazon.com/alexa-skills-kit/big-nerd-ranch/alexa-account-linking

I am now now getting as far as the final account linking page, but it keeps saying 'unable to link your skill'

I am currently using a redirect url of:

https://layla.amazon.com/api/skill/link/XXXXXXXXXXX?code='.$accessToken.'&state='.$_SESSION['state'].'&secret='. $tokenSecret.'&client_id=etsy-alexa-skill

Have i included all the necessary parameters for a 1.0 integration or is this not where the problem lies?

0 Likes 0 ·
WangChao@Amazon avatar image
WangChao@Amazon answered

Could you please try change your redirect url to be like "https://layla.amazon.com/api/skill/link/XXXXXXXXXXX#state=xyz&access_token=2YotnFZFEjr1zCsicMWpAA&token_type=Bearer" and try again?

More information about redirect url could be found at Linking an Alexa User with a User in Your System.

2 comments
10 |3000 characters needed characters left characters exceeded

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

If i use the # instead of ? when redirecting to the redirect url i receive a blank page with just {"message":null}. I am using Auth code grant with etsy and i see that the url you provided is recommended for implicit grant so this may be why.

I have searched and read pretty much all the literature i can find on account linking and just can't seem to find a step by step example of integrating with an Oauth 1 system.

0 Likes 0 ·

I have contacted appropriate internal team. Hopefully, we can get some document soon. In the mean time, please check if you can get some progress following instructions at https://forums.developer.amazon.com/articles/38610/alexa-debugging-account-linking.html. Thanks.

0 Likes 0 ·
WangChao@Amazon avatar image
WangChao@Amazon answered

Hi @spikereloaded,

Account Linking requires OAuth 2.0 authorization framework. Please take Alexa Account Linking: 5 Steps to Seamlessly Link Your Alexa Skill with Login with Amazon as reference. Thanks.

10 |3000 characters needed characters left characters exceeded

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