How Users Experience Account Linking for Alexa Skills
This topic shows common account linking experiences from a user's perspective, and what happens behind the scenes. The examples use a fictional custom skill, Ride Hailer, that lets users order rides.
For an explanation of account linking concepts, see Account Linking Concepts for Alexa Skills. For the special case of app-to-app account linking, which is not covered here, see Set up App-to-App Account Linking for Your Skill.
- How users know if a skill requires account linking
- How users experience account linking
- Related topics
How users know if a skill requires account linking
By default, users can enable a skill without starting the account linking flow. This configuration makes it easier for users to enable your skill and use the features that do not require authentication. For example, Ride Hailer might let users ask how long it will take to get to a particular destination even if they haven't linked their account. Alternatively, you can require users to link their account when they enable the skill.
The skill detail page in the Alexa app indicates whether account linking is required or optional, as follows:
How users experience account linking
The following are three common starting points at which users enter the account linking flow in the Alexa app:
- When enabling the skill – The user chooses the ENABLE TO USE button on the skill's detail page in the Alexa app.
- From the skill settings – The user goes to the skill settings page in the Alexa app after enabling the skill.
- From a skill card – The user tries to use a skill feature that requires authentication, and the skill sends a card to the Alexa app.
The following examples show the user flow for each case, and describe how the Alexa app interacts with the account linking components that you set up.
Initiating account linking when enabling the skill
In the following flow, the user initiates account linking when they enable the skill in the Alexa app.
To enable a skill within the Alexa app, the user chooses the ENABLE TO USE button on the skill detail page. If the skill requires account linking, the user is taken through an account linking flow similar to the following example.
|Visual||User experience||Behind the scenes|
The user starts the account linking process by going to the skill detail page and choosing ENABLE TO USE.
The Alexa app opens the skill's authorization URI.
The user sees Ride Hailer's log-in page and logs in with their Ride Hailer credentials.
The user views and accepts any Ride Hailer terms and conditions.
When the user has successfully logged in and accepted any terms and conditions, Ride Hailer's authorization server generates an authorization code to return to Alexa. This authorization code will let Alexa request an access token, which is what it ultimately needs to access the user's Ride Hailer data.
The user is returned to the Alexa app, and sees a success page.
Ride Hailer's authorization server redirects the user to the Alexa redirect URL, passing the authorization code in the query string. Alexa then opens Ride Hailer's access token URI to get an access token.
The user says, "Alexa, open Ride Hailer and order a car."
Alexa sends a
The skill extracts the access token from the request, validates the access token, and then uses the access token in a call to Ride Hailer's resource server, which contains the user data. The account linking sample skill on GitHub shows an example of how to extract and use the access token.
Initiating account linking from the skill settings after enabling the skill
In the following flow, the user initiates account linking from the skill settings in the Alexa app after enabling the skill.
Initiating account linking from a skill card
In the following flow, the user initiates account linking from a card that the skill sends to the Alexa app when the user tries to use a feature that requires authentication.
- Account Linking Best Practices for Alexa Skills
- Quick Reference: Add Account Linking to an Alexa Skill
- Add Account Linking to Your Alexa Skill
- Account Linking Concepts for Alexa Skills
Last updated: Nov 03, 2021