3

I now use cognito user pool as “account system”, and also created a identity pool, Use IOS app I can make user sign up , sign in , get the account identity id, sync dataset and other operations.

Then I use Cognito user pool as Oauth2.0 server to achieve Alexa Smart Skill Account link, it has been able to achieve account login, get AccessToken. (I have a post in the Alexa forum, they reply I can only get AccessToken, https://forums.developer.amazon.com/questions/81362/get-id-token-from-alexa-request-when-account-link.html )

But according to my previous experience, if you want to visit Identity pool, get Identity ID, need ID_token, so I would like to ask, Is there a way I can get Id_Token or identity ID by AccessToken or user name?

AWS.config.credentials = new AWS.CognitoIdentityCredentials({
    IdentityPoolId: 'us-east-1:79abd6b8-f141-4756-9272-a09ed0671d1b',
    region: 'us-east-1',
    Logins:{
         'cognito-idp.us-east-1.amazonaws.com/us-east-1_S5kbwuSkN' : id_token
    }
});
Bruce Pan
  • 31
  • 3
  • 1
    Nope. Can't be done (unless they fix it or add some new API) – agent420 Nov 02 '17 at 14:32
  • I spent a ton of time getting an Identity Pool working with multiple providers and this turns out to be a dead end solution. Was attempting this with Lamda Function running the Alexa Skills Kit SDK for Node.js. Sheesh ... – njlaboratory Feb 28 '18 at 00:21
  • I, too, spent 5+ hours trying to do it this way. It does not work. I followed the steps outlined here and had it working in 15 minutes: https://stackoverflow.com/questions/45926339/cognito-hosted-ui – Trenton Apr 02 '18 at 22:25
  • I've been trying to exchange the token I get from Alexa for the identity id in the lambda function (the alexa skill). Not sure if this is similar. – himanish.k Apr 28 '20 at 22:35

1 Answers1

1

You can only use id_token to get identity id to visit an identity pool. To get id_token, you need to configure your app client in Cognito User Pool to have 'openid' as a scope.