我想为注册应用程序制作一个简单的流程。
用户仅使用电子邮件注册 -> 验证/注册链接发送到电子邮件 -> 人们在该链接上注册(输入密码)
我已经用谷歌搜索过任何内容,但没有找到任何使用 AWS Cognito 实现的方法。
看起来 Cognito 强制用户至少使用电子邮件和密码进行注册才能获取确认链接
您可以通过
adminCreateUser
API 调用来注册用户。他们将收到一封包含临时密码的电子邮件。这种方法是可配置的。
请参阅:https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminCreateUser.html
使用:AdminCreateUser
使用 AWS 管理控制台或调用 AdminCreateUser API 创建新的用户配置文件。指定临时密码(将是您用户的密码)或允许 Amazon Cognito 自动生成密码。
指定是否将所提供的电子邮件地址和电话号码标记为已验证新用户。
通过 AWS 管理控制台为新用户指定自定义 SMS 和电子邮件邀请消息。 指定是否通过短信、电子邮件或两者都发送邀请消息。
用户创建成功后,
1. authenticate user using same user credentials
Use: SDK calls InitiateAuth(Username, USER_SRP_AUTH)
2. After success of initateAuth, amazon Cognito returns the PASSWORD_VERIFIER challenge with Salt & Secret block.
3. Use RespondToAuthChallenge(Username, <SRP variables>, PASSWORD_VERIFIER
4. Amazon Cognito returns the NEW_PASSWORD_REQUIRED challenge along with the current and required attributes.
5. The user is prompted and enters a new password and any missing values for required attributes.
6. Call RespondToAuthChallenge(Username, <New password>, <User attributes>).
7. After successful password change user can be able to login using same credentials added by you.
简短回答
- In that case, you can specify the temporary password(will allow Amazon Cognito to automatically generate one.).
- all user users will be forced to change their password only at first login.
有没有办法将临时密码设置为永久密码?