Skip to content

Unable to link Alexa skill with my mobile application in AWS (Dev mode testing)

0

Hello,

I am trying to link my mobile application with my Alexa skill through AWS, but I keep getting the error “Unable to link the skill at this time.”

Here is my flow:

  1. Login flow is working fine (user can sign in successfully).
  2. After login, my API returns the token response in the following format:
 {
"access_token": "accessToken",
 "refresh_token": "rotatedRefreshToken",
"token_type": "Bearer",
 "expires_in": 3600
}
  1. When I test in development mode (for testing purpose only), after this step, Alexa shows the error during account linking.

My question:

  1. Is there something wrong with my token response JSON structure?
  2. Do I need to configure anything specific in AWS / Alexa console for testing in dev mode?
  3. Could this issue be because of expires_in value or refresh token handling?

Any guidance would be really helpful to resolve this.

Thanks in advance!

1 Answer
0

Based on the information you've provided, your token response structure appears to be correct. The JSON format with "access_token", "refresh_token", "token_type", and "expires_in" matches the expected format for OAuth token responses that Amazon Cognito and similar authentication services use.

The issue might be related to one of several factors:

  1. Browser or network issues: Try clearing your browser cache and cookies, using incognito/private mode, or trying a different browser or network connection.

  2. Authentication configuration: Ensure that your Alexa skill's account linking configuration matches exactly with your authentication service settings. This includes redirect URIs, client IDs, and client secrets.

  3. Token endpoint issues: Verify that your token endpoint is publicly accessible and responding correctly to requests from Alexa's servers.

  4. Token validation: Alexa may be attempting to validate the token but encountering issues. Make sure your tokens are properly formatted and signed if using JWTs.

  5. Permissions: Check that your skill has the necessary permissions configured in the Alexa developer console.

For testing in development mode specifically:

  • Confirm that your development endpoints are publicly accessible
  • Verify that all security certificates are valid
  • Ensure your authentication flow works end-to-end outside of the Alexa environment first

The "expires_in" value of 3600 (1 hour) is standard and shouldn't cause issues. Your refresh token handling should be fine as long as your authentication server properly accepts and processes refresh token requests.

If the problem persists, you might want to check your server logs during the account linking attempt to see if there are any specific errors being returned that could provide more insight into what's failing during the process.
Sources
The token issuer endpoint - Amazon Cognito
Community | Build On Answered | All About Amazon Alexa | S02 EP02

answered a year ago

  • 1. Browser or network issues

    • When I enable the skill, my login page opens. After submitting, I log in successfully, and then I am redirected back to aws Alexa application . Then authorize API also gets triggered. Everything I receive is properly verified, and only after I send a response, this issue occurs.

    2. Authentication configuration

    • In authentication, I receive the client ID, secret key, and redirect URI. I compare them, and after verifying that everything matches, I send the response.
    Token response => {
    access_token:
    'd639de6cdbd6c27148bd3d122040bae1efadc5aec780c7720a5c09e358c0f4f0',
    refresh_token: 'feafaa11edc6207d8550b6bfc91c4588ad3f4e69bbd5997915e159e5af0f30c068a75fa546544a81c59cdd84cb74bc1a20e440400952899ab5743ea4ba41ea1f',
    token_type: 'Bearer',
    expires_in: 3600
     }
    

    3. Token endpoint issues

    • My token endpoint is supposed to be publicly accessible because Alexa from AWS sends requests to it. I respond to those requests, but after that, this issue occurs. -It sounds like Alexa is successfully reaching your token endpoint, but something in the response or the flow afterward is causing the “Unable to link” error.
    • We should check:
    1. The format of the token response (access_token, token_type, expires_in, refresh_token, etc.).
    2. The redirect_uri in the response – it must match exactly what Alexa expects ?.
    3. Any logs from Alexa – sometimes it gives an error code or reason that tells exactly what went wrong ?.
    • If you share a sample of your
  • 4. Token validation

    • I generate tokens using crypto for token validation. Will this cause any issue in token generation?
    • I send the response like this:
    Token response => {
    access_token:
    'd639de6cdbd6c27148bd3d122040bae1efadc5aec780c7720a5c09e358c0f4f0',
    refresh_token: 'feafaa11edc6207d8550b6bfc91c4588ad3f4e69bbd5997915e159e5af0f30c068a75fa546544a81c59cdd84cb74bc1a20e440400952899ab5743ea4ba41ea1f',
    token_type: 'Bearer',
    expires_in: 3600
     }
    
    • Here, the access token is generated as 32 bytes and the refresh token as 64 bytes.

    5. Permissions

    • I have no idea how to configure permissions in the Alexa Developer Console.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.