Alexa Account Linking with Auth0
Jan König
·
·Updated Feb 2024
·16 min read
Account Linking allows your Alexa Skill to connect to an external identity system. This tutorial shows how to set up Auth0 as the OAuth 2.0 provider and handle the access token inside your Jovo app.
What you'll set up
- ✓ Auth0 application with Authorization Code flow
- ✓ Alexa Skill account linking configuration
- ✓ Token retrieval inside Jovo handlers
- ✓ User profile fetching from Auth0 Management API
1. Create an Auth0 Application
Log in to auth0.com, create a new Regular Web Application, and note your Domain, Client ID, and Client Secret. Set the Allowed Callback URL to the Alexa redirect URI: https://pitangui.amazon.com/api/skill/link/<YOUR_VENDOR_ID>
2. Configure Account Linking in Alexa Console
In the Alexa Developer Console, navigate to Account Linking and fill in:
- Authorization URI:
https://YOUR_DOMAIN/authorize - Access Token URI:
https://YOUR_DOMAIN/oauth/token - Client ID/Secret: from Auth0
- Scopes:
openid profile email
3. Access the Token in Jovo
LAUNCH() {
const token = this.$request.getAccessToken();
if (!token) {
return this.$send({
message: 'Please link your account in the Alexa app.',
card: { type: 'LinkAccount' }
});
}
// use token to call Auth0 userinfo endpoint
}