【问题标题】:AWS cognito forgot password API issueAWS cognito 忘记密码 API 问题
【发布时间】:2017-02-03 18:22:52
【问题描述】:

我正在使用 AWS Cognito 的 forgot password API 它工作正常。 但我面临一个问题。 我使用手机号码注册,然后我将电子邮件属性添加到该用户池记录并调用forgot password API 它在手机号码上发送验证码,但我希望它通过电子邮件发送,我该怎么做?这是我的代码。

AWS_COGNITO.forgot_password({ client_id: ENV['AWS_WEB_APP_ID'], username: 'valid username'})

根据API document,#forgot_password 在哈希中仅采用两个值

如果需要我提供更多信息,请告诉我。谢谢

【问题讨论】:

    标签: ruby amazon-web-services aws-cognito


    【解决方案1】:

    编辑: 根据以下文档,尚不支持通过电子邮件进行 MFA。

    1. https://github.com/aws/aws-sdk-ios/issues/382
    2. [2017 年 1 月 17 日]https://forums.aws.amazon.com/message.jspa?messageID=762060

    使用get_user查看用户详细信息

    如果mfa_options[0].delivery_medium 是“SMS”,请致电set_user_settings 将传递媒介更新为“EMAIL”。

    【讨论】:

    • 我试过AWS_COGNITO.set_user_settings({ access_token: user.aws_access_token, mfa_options: [{ delivery_medium: "SMS", attribute_name: "phone_number",}, { delivery_medium: "EMAIL", attribute_name: "email",}],}) ,但我得到了这个错误Aws::CognitoIdentityProvider::Errors::InvalidParameterException: Only phone_number attribute is currently supported as a MFA option.
    • 是否可以通过他们的 Web 控制台将交付媒介更新为 EMAIL?
    • 我的问题没有解决,但我正在等待更好的答案。
    猜你喜欢
    • 2022-08-13
    • 2018-02-22
    • 1970-01-01
    • 2018-04-12
    • 2017-10-09
    • 2015-05-21
    • 2011-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多