amazon-web-services - 赋予用户在 Cognito 中重置过期临时密码的能力

标签 amazon-web-services amazon-cognito

我知道管理员可以使用以下命令从控制台重置用户的临时密码

aws cognito-idp admin-create-user --region us-east-1 --user-pool-id us-east-1_youruserpoolid --username theusername --message-action RESEND

但在这里我需要用户有触发选项的东西,并且在触发之后他应该为他的电子邮件获取新的临时密码。它有点像自助服务选项,用户不必调用管理员来重置他的临时密码。

我尝试使用 resendConfirmationCode 来自

https://github.com/aws-amplify/amplify-js/blob/master/packages/amazon-cognito-identity-js/src/CognitoUser.js

有要求:

{ClientId: "v3miuf2k********", Username: "suni*********"}

得到的回应是:

{code: "NotAuthorizedException", name: "NotAuthorizedException", message:  "Can't resend confirmation code for this user"}

code: "NotAuthorizedException"
message: "Can't resend confirmation code for this user"
name: "NotAuthorizedException"

最佳答案

只是想发布 AWS 支持的官方回复,如果将来有人需要答案。

  1. I can see the error is caused by the API resendConfirmationCode which supposed to be called without any credentials, however, the error indication message said "NotAuthorizedException". Is this API called many times? That may trigger AWS backend side protection of anonymous attacking.

  2. Can you have a try to create a new user with the same email and use the same API to send confirmation code? If there is an existing user with the same email address but not confirmed, it's fine to create a new user with the same email address.

关于amazon-web-services - 赋予用户在 Cognito 中重置过期临时密码的能力,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52335925/

相关文章:

bash - 如何将同一个 AMI 同时复制到多个区域?

amazon-web-services - 如何覆盖 AWS Batch 作业中的 docker 镜像?

amazon-web-services - 按计划对每个 DynamoDb 条目运行 lambda?

amazon-web-services - AWS 自定义验证电子邮件模板

amazon-cognito - 未登录用户的 Appsync 授权

Java:-Dhttps.proxyHost 未被使用

amazon-web-services - 如何在 spacy 运行时下载 "en_core_web_sm"模型?

node.js - AWS Cognito 可以在 EB 上的 Node/Express/React 应用程序中使用吗?

javascript - 我如何从 AWS Cognito Api 获取机器到机器的 token

java - 用于 Cognito 的 Java 中的 AWS Lambda 响应