amazon-cognito - 如何使用 Amplify 在没有旧密码的情况下更新 Cognito 用户池中的用户密码?
问题描述
我们有多步注册表单,用户可以在步骤 2 中设置密码。(用户注册应该在步骤 1 本身进行)因此,我们将在步骤 1 中设置随机密码,并在 Cognito 用户池中注册用户详细信息。但最终用户从第 2 步提交实际密码。Cognito 不会在不发送旧密码(从第 1 步随机生成)的情况下更新密码(从第 2 步开始)。Cognito 认为这个过程将是密码更新。
那么我们需要如何处理这种情况呢?或者是否有任何放大提供的选项/技巧来克服这种情况?
解决方案
More context is needed to fully understand why a random password is necessary for the user in this situation.
For example, if you are trying to create a multi-screen signup process and you don't want the user to get to the end of the process only to find out their password doesn't meet standards, e-mail already exists, etc., it may be more conducive to the user experience to check if the user already exists in the user pool first using ListUsers, collect the data as they move through the steps, and finally call the SignUp API call.
While I would highly recommend reconsidering the approach taken, the AdminSetUserPassword is a backend API call that can be used to set a permanent password for the user, although extreme care should be taken with this method to prevent the API call from being used maliciously on another user.
推荐阅读
- c# - 如何确定两个“ref”变量是否引用同一个变量,即使为空?
- python - 缺少 python3 的 opencv cv2.so 绑定
- php - REST API 中的会话原则
- aframe - 在框架的文本实体中添加引导字形图标
- node.js - 如何使用 nodejs 在一天内运行 4 次 cron 作业?
- node.js - 为什么用户在 Microsoft Graph API 和 bot 框架中的用户 ID 之间具有不同的 ID 格式?
- oracle-apex - 如何在 Oracle APEX 5.1 中将图像放在导航列表中
- airflow - 从 Airflow 的数据库中删除 SubDag
- java - Junit restcotroller 测试方法
- javascript - 如何在rails控制器中替换内联javascript