Account linking works the same way for all languages and you should be familiar with OAuth2
to configure account linking in developer portal.
Read this answer about OAuth2
In Alexa users can link account in 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.
When you link an account with your skill, every subsequent request from the skill will include an access token. You can then use this accessToken
to get associated data for linked account.
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.xxxxxxxxxxx",
"application": {
"applicationId": "amzn1.ask.skill.xxxxxxxxxx"
},
"user": {
"userId": "amzn1.ask.account.xxxxxxx",
"accessToken": "xxxxxxxxxxxxxx"
Except for the code to send an Account Link card there is no coding involved in link-an-account process.