Alexa Connected Devices   >    Development Resources    >    Smart Home Skill Tutorial    >    Step 5: Provide Account Linking Information

Step 5: Provide Account Linking Information

So far, we have established the link between the Alexa Cloud and the Lambda function. However, the Lambda function still needs a way to identify the corresponding user in the 3P cloud, and this is where account linking comes into the picture.

In this section, we will tell Alexa how should an Alexa user be linked with the corresponding 3P user.

5.1 Setting up LWA
Note:

This section requires account information from your OAuth 2.0 provider, which enables customers to associate their device cloud account with your smart home skill. You can use Login with Amazon or another OAuth provider for this section.

1. Open a new tab in the browser, and navigate to https://developer.amazon.com/dashboard

2. Choose “Login with Amazon”

login with amazon nav screenshot

3. Click Create a new Security Profile

create a new security profile screenshot

4. Enter a name and description for your security profile. For example, my-smart-home-skill-profile

5. For Consent Privacy Notice URL, put in a url that will serve as your privacy policy.

6. Click Save

name your new security profile screenshot

7. Copy the Client ID and Client Secret. Be sure to not copy any trailing spaces. 

 

 Be careful not to copy any additional characters or whitespace.

credentials screenshot

8. Keep this tab open. We will need this in a bit.

5.2 Setting up Account Linking using LWA

1. Back on the skill settings tab for your Smart Home Skill in the Alexa Developer Console, click Account Linking on the left navigation bar.

account linking nav screenshot

2. Fill in the following information -

  • Authorization URI: Type https://www.amazon.com/ap/oa
  • Access Token URI: Type https://api.amazon.com/auth/o2/token
  • Paste the Client ID and Client secret you copied in Step 5.1
  • Leave Your Authentication Scheme to the default setting of HTTP Basic (Recommended)
  • Scope: Type profile:user_id

 

 (Since Scope is a mandatory field, we pick one of the three scopes supported by LWA.

 

3. Copy the Redirect URLs at the bottom of the page, each url is meant for a corresponding region. You will need this in the next few steps.

account linking info screenshot
5.3 Completing oAuth

1. Navigate back to the LWA Console that you have open in another tab.

2. Click the gear icon under manager and choose Web Setting.

web setting option screenshot

3. Click Edit button, and the “Web Settings” tab if necessary.

edit web settings screenshot

4. In the Allowed Return URLs section, paste the Redirect URLs you copied from the skill settings page in Step 5.2 above

allowed return URLs screenshot

5. Click Save

Congratulations! We have now completed the account linking, and are now ready to test the skill.