我正在尝试通过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",
}]
})
并使用confirm_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
我认为不是最佳实践的用户登录方法。