我现在使用cognito用户池作为“帐号系统”,还创建了一个身份池,使用IOS app我可以让用户注册,登录,获取帐号身份id,同步数据集等操作。
然后使用Cognito用户池作为Oauth2.0服务器来实现Alexa Smart Skill的账号链接,它已经能够实现账号登录,获取AccessToken。(我在Alexa论坛上有一个帖子,他们回复我只能得到AccessToken,https://forums.developer.amazon.com/questions/81362/get-id-token-from-alexa-request-when-account-link.html )
但根据我之前的经验,如果你想访问身份池,获取身份ID,需要ID_token,那么我想问一下,有没有办法通过AccessToken或用户名来获取Id_Token或身份ID?
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
}
});发布于 2017-12-09 03:46:00
访问身份池时,只能使用id_token获取身份id。要获取id_token,您需要在Cognito User Pool中配置您的应用程序客户端,使其具有'openid‘作为作用域。
https://stackoverflow.com/questions/45558388
复制相似问题