0

I trying to set up Oauth2 for linking account for an Alexa skill. My current back end runs in python/flask and I'm thinking of using rauth library to do so.

I have very little understanding of Oauth2 and I am looking for sample code that shows how to share resources with the an Alexa skill. Does anyone have a good example?

johndoe
  • 4,387
  • 2
  • 25
  • 40
AlexP
  • 419
  • 6
  • 13

1 Answers1

0

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:

  1. From the skill detail card in the Alexa app while enabling the skill.
  2. 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.

johndoe
  • 4,387
  • 2
  • 25
  • 40