- Configure an Authorization Code Grant
- Configure an Implicit Grant
- Validate and Use Access Tokens in Custom Skill Code
When to use account linking
Use account linking in a custom skill if you need to connect the user’s Alexa account with an account in another system and retrieve personalized information from that other system. For example:- Connect a skill to a service you run.
- Connect a skill to a third party service that supports OAuth 2.0.
How users link their accounts
Users can start account linking in one of two ways:- From the skill detail card in the Alexa app while enabling the skill
- From a link account card in the Alexa app after making a request that requires authentication.
accessToken) in the request to your skill. For more details, see Get the Access Token from the Request.
- Start from the Skill Detail Card
- Start from a Link Account Card
- User Completes the Account Linking Process
Start from the skill detail card
If your skill requires account linking, the skill detail card displays a notification that account linking is required to use the skill. When the user clicks Enable, the Alexa app automatically starts the account linking process.
Skill detail card notes account linking is required

Skill detail card for an enabled skill
Start from a link account card
This flow is possible if the user skips the account linking process when they enable the skill or if they enable the skill by voice instead of with the Alexa app. Users can skip the account linking flow when enabling the skill if you select the option to let users enable it without account linking. After the user makes a request that requires authentication, your skill returns a link account card (LinkAccount) directing the user to connect their accounts. You can determine that the user’s account isn’t linked by checking for the presence of the access token (accessToken) in the request to your skill. For more details, see Get the Access Token from the Request.
The user can then start the process from the link account card.

Link account card in the Alexa app
User completes the account linking process
Regardless of how the user starts the process, the remaining steps are the same:- After the user starts the account linking process, the app displays a login page for the other service.
- The user provides their credentials in the login page and authenticates with the service.
- The user is redirected back to a “success” page within the Alexa app and the skill is ready to use.

Login page displayed in the Alexa app

Account linking success screen in the Alexa app
User interacts with the skill
Users can invoke the skill and make requests normally. If the user’s account has been successfully linked, the requests include the access token. The skill uses the token to access information in the other system. For example, in the following interaction, the Ride Hailer skill uses the token to get the user’s profile, which has payment information and a default “work” location: If the user’s account has not been linked yet, the request doesn’t include the access token. The skill can check for this and return both:- Speech text that briefly explains the benefits of linking accounts.
- A link account card that the user can use to link their account in the Alexa app.
User disables a skill
If the user disables the skill in the Alexa app, the Alexa service deletes the access token associated with that user and skill. This removes the link between the user’s Alexa account and their account in your service. If the user later re-enables the skill, they will need to initiate the account linking process again to create a new link between their Alexa account and their account with your service.Authorization code grant type for custom skills
The Alexa Skills Kit supports two OAuth authorization grant types for custom skills:- Authorization code grant type
- Implicit grant type
- In an implicit grant, the authentication server returns the access token after the user logs in during the account linking process.
- In an authorization code grant, the authentication server returns an authorization code after the user logs in during the account linking process. Alexa then uses this code to request an access token / refresh token pair from the authorization server. Alexa can then use the refresh token to request a new access token / refresh token pair after the old token expires.
Steps to implement account linking in a custom skill
To add account linking to your custom skill, you do the following:- Decide whether to use an implicit grant or an authorization code grant as your grant type.
- Configure your skill with account linking in the developer console in the TOOLS > Account Linking section. For details, see one the following:
- Add account linking logic to the service for your skill. Your skill code needs to check for the access token on incoming requests and take appropriate actions. For details, see Validate and Use Access Tokens in Custom Skill Code.

