Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alexa, Unable to link your skill

I am creating custom skill in Alexa which uses account linking. I have created my own authentication server using OAuth2 php library and I have configured the authorization url and token urls in skill configuration.

When I try account linking from Alexa mobile app, I get error 'unable to link your skill'. following is my work progress.

  • Alexa app is able to open my authentication url.
  • I am able authorize and provide authorization code with redirect uri.
  • Alexa is requesting for access token using authorization code previously provided.
  • I am able validate authorization code and response back with access token and refresh token.
  • Alexa fails in this step to link with my skill. It say's 'Unable to link your skill'.

I have gone through my forums about the same, but couldn't find what exactly the issue is. Could any one please help me out in this regard.

like image 538
Arun Avatar asked Feb 23 '17 12:02

Arun


2 Answers

I was facing the same issue too , the problem was solved by selecting "credentials in request body" (default being Http basic) for "Client Authentication Scheme", since the access token in my case was sent in the body of the message. Check how the authentication token is sent by your server.

like image 186
hungryspider Avatar answered Sep 23 '22 21:09

hungryspider


Thought this might help anyone wondering how the Alexa service is posting to their OAuth endpoint since it's pretty opaque and undocumented. The redirect to the Alexa service initiates a POST request to the defined OAuth endpoint with the post body in x-www-form-urlencoded format not JSON. So the POST looks like this. ​

POST /authentication/1/oauth HTTP/1.1 url.Values{} grant_type=authorization_code&code=XXXXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=https%253A%252F%252Fpitangui.amazon.com%252Fapi%252Fskill%252Flink%252FM9BEOG3DM65SQ&client_id=XXXXXXXXXXXXXXXXXXXXXX

If your endpoint isn't parsing this data or expecting some format that can be unmarshaled easily then it is probably failing with a 406 response.

like image 37
Rob Carpenter Avatar answered Sep 22 '22 21:09

Rob Carpenter