【发布时间】:2017-04-28 04:36:07
【问题描述】:
我正在尝试通过 ruby SDK 使用 AWS Cognito 服务进行用户身份验证。
我可以注册,使用方法确认注册过程
resp = client.sign_up({ client_id: "ClientIdType",
secret_hash: "SecretHashType",
username: "UsernameType",
password: "PasswordType",
user_attributes: [{ name:"AttributeNameType",
value: "AttributeValueType",
}],
validation_data: [{
name: "AttributeNameType",
value: "AttributeValueType",
}]
})
并使用
确认_sign_up resp = client.confirm_sign_up({client_id: "ClientIdType",
secret_hash: "SecretHashType",
username: "UsernameType",
confirmation_code: "ConfirmationCodeType"
})
但在尝试通过initial_auth 登录用户时出现错误缺少必需的参数SRP_A
cog_provider.initiate_auth({client_id: "xxxxxxxxx", auth_parameters: { username: "xxx", password: "xxx"}, auth_flow: "USER_SRP_AUTH"})
SRP_A 表示在哪里可以找到它。
我已搜索过此问题,建议使用admin_initiate_auth 方法登录用户,我认为这不是最佳做法。
【问题讨论】:
标签: ruby-on-rails ruby amazon-web-services amazon-cognito srp-protocol