AWS Cognito-用户卡在CONFIRMED中,并且email_verified = false [英] AWS Cognito - User stuck in CONFIRMED and email_verified = false

查看:146
本文介绍了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标志为假,用户无法更改密码。

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标志为假。

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属性。可以将这些标记为true的唯一方法是通过最终用户可以完成的代码验证过程。管理员级别的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天全站免登陆