AWS Cognito - 用户卡在 CONFIRMED 和 email_verified = false [英] AWS Cognito - User stuck in CONFIRMED and email_verified = false

查看:17
本文介绍了AWS Cognito - 用户卡在 CONFIRMED 和 email_verified = false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过电子邮件验证已确认但 email_verified 为假的用户?

How do I go about email verifying a user who is CONFIRMED yet email_verified is false?

场景大致是一个代理代表他们注册用户,我通过管理调用adminConfirmSignUp确认用户.此时,用户无法更改密码,因为 email_verified 标志为 false.

The scenario is roughly an agent signs up user on their behalf, and I confirm the user through the admin call adminConfirmSignUp. At that point, the user cannot change their password because of the email_verified flag being false.

我无法调用 resendConfirmationCode,因为用户已被确认.

I can't call resendConfirmationCode because the user is already confirmed.

我无法调用 forgotPassword,因为 email_verified 标志为 false.

I can't call forgotPassword because the email_verified flag is false.

我能想到的最好方法是删除用户帐户并调用 signUp(提示他们重新输入密码或新密码),从而重新创建他们的帐户.

The best I can think of is deleting the user account and calling signUp (prompting them to re-enter their password or a new password), hence recreating their account.

推荐答案

目前,Cognito 不允许外部代理代表用户更新 email_verified 和 phone_verified 属性.将这些标记为真的唯一方法是通过可由最终用户完成的代码验证过程.例外情况是管理员级别的 API,如下面的答案所述,但不应从客户端完成.

Currently, Cognito does not allow an external agent to update the email_verified and phone_verified attributes on behalf of the user. The only way these can be marked as true is through a code verification process which can be done by the end user. The exception to this is with admin level APIs, as answers below describe, but those shouldn't be done from client side.

过程是这样的:用户登录并获取访问令牌.然后,他们使用要验证的属性调用 GetUserAttrbuteVerificationCode API.这将向用户提供一个代码,可以通过调用 VerifyUserAttribute 来使用该代码,这将翻转属性为已验证.

The process is this: user signs-in and gets an access token. They then call GetUserAttrbuteVerificationCode API with the attribute they want to verify. This will deliver a code to the user, which can be used by calling VerifyUserAttribute which will flip the attribute as verified.

这篇关于AWS Cognito - 用户卡在 CONFIRMED 和 email_verified = false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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