Oauth Knowledge Required
Implementing account linking with Alexa requires knowledge of OAuth.
Implementing account linking in your Alexa Skill allows you to identify users to e.g. merge the Contact Profile of an Alexa user with that of a Facebook user. How to implement account linking is thoroughly documented in the Amazon documentation.
This guide therefore only focuses on how to start account linking from a Flow in COGNIGY.AI, and how to get the access token from a request when account linking is done.
In order to start account linking in a Flow you need to respond to the input with an
Account Linking Card. In order to create one of these, follow the steps below:
- Create a Say Node
- Open the
Alexatab in the Say Node
- Open the
Cardssection and select the
When a user sends a message that triggers this Say Node, they will be asked to link their account before proceeding with interacting with your Skill.
Checking Whether The User Is Authenticated
Before asking the user to link their account, you can check whether they already have an access token. You can do this by accessing
ci.data.accessTokenin your Flow. If this variable is defined, then the user already has their account linked and you shouldn't send the link account card
The access token will be available in
ci.data.accessToken in your Flow once the user has completed account linking. This can then be used in e.g. an API Node / DB Node to exchange the token for some profile information.
Updated almost 3 years ago