Skip to main content

Alexa Account Linking Starting from Your App (Optional)

Introduction

This account linking flow enables users to link their Alexa user account with their account in another service by starting from your app. When you start the account linking flow from the app, users can:

  • Discover your Alexa skills through your app.
  • Initiate skill enablement and account linking from within the app.
  • Link their account without entering Alexa account credentials if already logged into Alexa app. They will have to log in to their app service once when trying to link accounts.
  • Link their account from your app using Login with Amazon (LWA), when the Alexa app is not installed on their mobile device.
note

The developer documentation for the app-to-app linking starting from mobile app can be found here.

Prerequisites

RainMaker skills using StackSet must be deployed. The detailed steps are given in the section Voice Assistant Integration.

If not done, please follow the Voice Assistant Integration steps and come back here to enable app-to-app account linking.

Following are the steps to configure Alexa app-to-app account linking:

Creating Redirection URL for Mobile Apps

Users are redirected to your app after they acknowledge the linking request in the Alexa app or LWA. For this redirection to happen, it is required to create universal links for iOS app and app links for Android app.

Following are the steps to host the files for universal links and app links in AWS S3.

note

Please ensure that your user has admin privileges before moving onto the next steps.

Creating S3 Bucket

  1. Go to AWS Console > Services > S3.

  2. Click Create bucket.

  3. Add the name for the bucket.

  4. Select the region where you want to create the bucket.

  5. Scroll down to Object Ownership settings and select the ACLs enabled option.

    Change Object Ownership settings

  6. Scroll down to Block Public Access settings for this bucket settings.

  7. Untick the option Block all public access, and accept the acknowledgment. Note that this step is mandatory for linking process.

    Disable Block Public Access setting

  8. Scroll to the end of the page and select Create Bucket.

  9. From the list of the buckets, click the newly created bucket.

  10. Click Create Folder and create .well-known folder.

    Creating folder on S3

  11. Tick the small box in front of the .well-known folder and click the Copy URL option.

    Copy folder URL

  12. Remove the .well-known/ suffix from the URL noted in step 10. This value will be used in subsequent steps and is referred to as redirectURL.

  13. To create the app link (Android) or universal link (iOS), refer to the steps given in the following:

Uploading the Files to S3 with Public Read Access

  1. Go to AWS Console > Services > S3.

  2. From the list of the buckets, click the newly created bucket.

  3. Go to .well-known folder.

  4. Upload the files in .well-known folder in S3 bucket:

    • For Android app links, upload the assetslinks.json file, created in the previous section.
    • For iOS universal links, upload the apple-app-site-association file, created in the previous section.
    note

    If you want to upload files for both iOS and Android, steps 5-10 need to be done for both files.

  5. Scroll down and expand the Permissions section.

    Object Permissions

  6. Select the Grant public-read access option.

    S3 ACLs

  7. Accept the acknowledgment.

    S3 object public Acknowledgement

  8. Click the Permissions tab. Update the bucket policy by replacing the bucket name with your own, then save the changes.

    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Principal": "*",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::my-bucket-name/*"
    }
    ]
    }

    S3 bucket permissions

  9. Click the Upload button at the end of the page.

Configuring Callback URL in RainMaker

  1. Log in to the RainMaker dashboard with admin credentials.

  2. Go to the Deployment Settings tab.

  3. Click Identity Configurations.

  4. Look for Cognito app client with client name "esp-rainmaker-alexa-skill".

  5. Update callback URLs for esp-rainmaker-alexa-skill client. Add the redirectURL value copied in step 12 of the Creating S3 bucket section, to the existing callback URLs.

    Alexa callback URLs

    note

    The two URLs should be separated by a comma(,).

Enabling App-to-App Account Linking for Alexa Skills

  1. Log in to Alexa Developer Console.

  2. From the list of the skills, select the skills that you want to configure for app-to-app linking.

  3. Click ACCOUNT LINKING on the left navigation bar.

    Account Linking tab

  4. Enable the option Allow users to link their account to your skill from within your application or website.

    Enable App Linking

  5. Scroll down to Your Redirect URLs setting.

  6. Click the + sign to add the redirect URL.

  7. Enter the redirectURL value copied in step 12 of the Creating S3 bucket section.

    Redirect URL configuration

  8. Add the client secret for esp-rainmaker-alexa-skill app client. You can find the steps to obtain the client ID and client secret here.

    RM Client Secret

  9. Save the changes.

Getting the Value of Alexa Access Token URL

Make sure you are in the same AWS region where you have deployed RainMaker.

  1. Log in to AWS console and go to API Gateway Service.

  2. Look for API Gateway AlexaSkillLinking AWS Api Gateway.

    API gateway

  3. Go to Stages tab.

    Stages

  4. Expand the dev stage.

  5. Click POST method.

  6. Copy the Invoke URL. This URL will be required while configuring "alexaAccessTokenURL" for mobile apps.

    Fetch Token URL

After completing the above configuration steps, proceed to configure Alexa account linking for mobile apps.

Follow the steps below to set up Alexa account linking for iOS and Android applications:

On this page