Authenticate your device

Your Raspberry Pi now has the AVS Device SDK installed and your credentials loaded, but your device still needs a authorization token so your client maintains a connection to the Alexa Voice Service. If you design an Alexa-enabled product and ship a million of them to your customers, they can all use the same Client ID and ProductID - but each individual device will require a unique authorization token to authenticate with AVS through Login With Amazon (LWA).

Normally, your customer gets a authorization token delivered when they activate your (their) device using a companion app, companion site, or code-based linking (CBL). For this tutorial, you're both the device maker and the customer. You use the script to launch the Sample App and request a authorization token for your prototype device.

Start the Sample App

In a terminal window, navigate to the /home/pi directory and run

cd /home/pi/
sudo bash

Get your Authorization Code

Once the sample app starts, you'll see a series of rapidly scrolling debug messages in the terminal window stating, Checking for authorization. Scroll through the debug messages and look for a box with a URL, it contains your Alexa authorization code.

Submit your Authorization Code

  1. Go to Use any internet-connected device (for example, your phone).
  2. Log in with your Amazon developer credentials.
  3. Enter the authorization code, provided by your sample app, into the authorization box.

It might take up to 30 seconds for CBLAuthDelegate to successfully get a authorization token from Login With Amazon (LWA). You'll get a success message, and your sample app should be ready to go!


Your hard work has paid off, and now it's time to Talk with Alexa!