Account Linking for Smart Home and Other Domains
All smart home and video skills must implement account linking to connect the identity of the Alexa user with an identity in the device cloud system. Some music skills also support account linking.
For an explanation of account linking concepts, see Account Linking Concepts for Alexa Skills. For the user experience, see How Users Experience Account Linking for Alexa Skills.
Prerequisites
To implement account linking for smart home skills, you must have the following prerequisites:
- Your system must support OAuth 2.0 and the authorization code grant type.
If you don't have your own authorization server, you can use Login with Amazon (LWA) or any OAuth 2.0 provider that has a certificate signed by an Amazon-approved certificate authority. Note that you cannot usehttps://letsencrypt.org/
, even though it's on the certificate list. - Your OAuth provider must meet the requirements for account linking for Alexa skills.
Configure account linking
You configure your skill with account linking in the Alexa developer console in the TOOLS > Account Linking section.
For details about the account linking configuration fields, access tokens, and the overall authorization code grant flow, see Configure an Authorization Code Grant.
Update your skill code with account linking logic
Each directive sent to your skill includes the access token to identify the user. Your skill code needs to validate the token, and then use it to access information about the user. For more details, see the following topics:
In addition, if you enable the Send Alexa Events permission for the skill, your skill must handle the AcceptGrant
directive. If your skill doesn't handle this directive, account linking fails when the user attempts to enable your skill. For more details, see Request Access to the Alexa Event Gateway.
Automated registration
With automated registration, your skill can allow users to automatically register with your system during device setup and link that identity with their Alexa identity. To learn more about this feature, contact your Amazon business representative or fill out the contact us form.
Related topics
- Validate and Use Access Tokens in Smart Home and Video Skill Code
- Validate and Use Access Tokens in Music Skill Code
- Quick Reference: Add Account Linking to an Alexa Skill
- Add Account Linking to Your Alexa Skill
- Account Linking Concepts for Alexa Skills
Last updated: Sep 10, 2024