Search code examples
iosswiftamazon-web-servicesamazon-cognitoalexa-voice-service

Can Amazon Cognito be a substitute for the Login-With-Amazon SDK?


I have an ios app working with Cognito for authentication. As I delved further into what amazon had to offer, I had come across Amazon's Alexa Voice Service and the Alexa Skills Kit. Going through the documentation from Amazon, it was mentioned that I have to use the Login-With-Amazon SDK for the purpose of authentication, upon which I will have access to Alexa Voice Services. I really need to know if there is a workaround to this. I am allowing unauthenticated access from my app, after checking if the username and password is already registered in my dynamoDB table. Do I still have to use the Login-With-Amazon SDK? Can I get Alexa working without it?


Solution

  • The user has to login to their Amazon account using the Login With Amazon SDK (LWA) regardless of whether they're using the Alexa Voice Service (AVS) for a device authorized via a mobile app, a website, or calling the REST API directly, you'll need an access token from LWA. A good overview of the auth flow is in the Getting Started Guide. So you will not be able to allow unauthenticated (i.e. anonymous) users to call the AVS. Cognito has a documented way to integrate LWA alongside your existing unauthenticated code, but your users will have to login with Amazon before you can leverage AVS.

    An explanation about why this is required clarified by an Amazonian in this thread with the statement:

    For AVS, we need the user's permission to access THEIR account data. That means you'll need to get an access token via the LWA SDK.