AWS使用刷新令牌Javascript [英] AWS Using refresh token Javascript

查看:120
本文介绍了AWS使用刷新令牌Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有关于如何使用刷新令牌在AWS Cognito上获取新idtoken的示例?

Are there any examples on how to use the refresh token to get a new idtoken on aws cognito?

我正在尝试使用 http://docs.aws.amazon.com/cognito-user- identity-pools / latest / APIReference / API_AdminInitiateAuth.html

但随后,它需要开发者凭据。

But then, it requires "developer credentials".

我想我可以在 http://docs.aws.amazon.com/cognito/latest/developerguide/developer-authenticated-identities.html#associate-developer-提供者

现在我不知道我还需要对我的代码做些什么才能处理这样的开发人员凭证?

Now I don´t know what else do I need to do on my code in order to handle such a developer credential?

这是我收到的消息:


用户:
arn: aws:sts :: 540029582710:assumed-role / Cognito_Skyline_User_Pool_ProdAuth_Role / CognitoIdentityCredentials
无权执行:cognito-idp:
资源上的AdminInitiateAuth:
arn:aws:cognito-idp:ap- northeast-2:540029582710:userpool / ap-northeast-2_7wGKApTQV

"User: arn:aws:sts::540029582710:assumed-role/Cognito_Skyline_User_Pool_ProdAuth_Role/CognitoIdentityCredentials is not authorized to perform: cognito-idp:AdminInitiateAuth on resource: arn:aws:cognito-idp:ap-northeast-2:540029582710:userpool/ap-northeast-2_7wGKApTQV"

谢谢

推荐答案

最后,我需要调用InitiateAuth而不是AdminInitiateAuth

It turned out, in the end, that I needed to call InitiateAuth instead of AdminInitiateAuth

http://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html

这篇关于AWS使用刷新令牌Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆