- Newest
- Most votes
- Most comments
Based on your detailed troubleshooting steps, it seems you've covered most of the common issues that cause account linking failures with Alexa skills. Let me address your specific concern about token length and format, and provide some guidance.
For the access token and refresh token, there isn't a strict length requirement from Alexa, but there are some best practices:
-
Access tokens: Your 32-byte access token (which would be 64 characters when hex-encoded) is perfectly acceptable. Typical access tokens range from 32 to 512 bytes.
-
Refresh tokens: Your 64-byte refresh token is also within normal parameters. Refresh tokens are typically longer than access tokens since they have a longer lifespan.
The token response structure should follow this format:
{
"access_token": "your_access_token_here",
"refresh_token": "your_refresh_token_here",
"token_type": "Bearer",
"expires_in": 3600
}
Since you've already verified your token structure and headers, here are additional areas to check:
-
Redirect URI handling: Ensure that the redirect_uri parameter received in the authorization request is exactly the same one you're using when redirecting back to Alexa.
-
Error logging: Add comprehensive logging to your token endpoint to capture any potential errors that might occur during the token exchange process.
-
HTTP status codes: Make sure your endpoint returns appropriate HTTP status codes (200 OK for successful responses, appropriate 4xx codes for client errors).
-
Token validation process: If you're using crypto for token generation, ensure the tokens are properly formatted strings that don't contain any special characters that might cause parsing issues.
-
Account linking configuration: Double-check that your account linking type (Auth Code Grant) is properly configured in the Alexa Developer Console, and that all URLs, client IDs, and secrets match exactly between your auth server and the Alexa skill configuration.
If the issue persists after checking these areas, you might want to implement a simple, temporary test endpoint that returns a hardcoded valid token response to isolate whether the issue is with your token generation logic or with another part of the account linking flow.
Sources
Unable to link Alexa skill with my mobile application in AWS (Dev mode testing) | AWS re:Post
Unable to link Alexa skill with my mobile application in AWS (Dev mode testing) | AWS re:Post
answered a year ago
Relevant content
- AWS OFFICIALUpdated 3 years ago
