I am trying to figure out how to link a skill with a custom user account. Here is what the documentation says:
Account linking flow for implicit grant (for use with custom skills):
The app displays your
login page right within the app, using the Authorization URL you
provide when registering your skill on the developer portal. When
the companion app calls this URL, it includes state
, client_id
,
response_type
, and scope
as query string parameters.
state
is used by the Alexa service during the account client_id
is a value defined by you when you set up account linking for the skill in the developer portal.response_type
is always token
for the implicit grant flow.scope
is an optional list of access scopes indicating the level of access requested. You define the set of scopes to support when enabling account linking for your skill. redirect_uri
is the URL to which your service redirects the user once the user is authenticated.The user logs in using their normal credentials for your site.
redirect_uri
and passes along the state
, access_token
, and token_type
in the URL fragment.access_token
for the Alexa user.Here is what I get form Amazon:
{
"client_id":"my-client-id",
"response_type":"token",
"state":"some_long_string",
"redirect_uri":"https:\/\/subdomain.amazon.com\/spa\/skill\/account-linking-status.html?vendorId=W5TGH673R
}
Based on what I read above I am redirecting back to:
https://subdomain.amazon.com/spa/skill/account-linking-status.html?vendorId=W5TGH673R&state=same_long_string&access_token=something-I-made-up&token_type=Bearer
Unfortunately this doesn't seem to work. Basically I get: Unable to link your skill
Any ideas?
I ran into a similar issue, and I had to use a hash instead of an ampersand before the token. My redirect url is:
https://subdomain.amazon.com/spa/skill/account-linking-status.html?vendorId=W5TGH673R#access_token=something-I-made-up&state=same_long_string&token_type=Bearer