我正在使用 boto3 连接 Amazon Cognito。我正在尝试使用 sign_up 方法;但是,有一个名为 SecretHash 的参数,我无法理解它是如何生成的。
关于SecretHash的原始文档:
SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
如果我不输入 SecretHash 参数,我会在下面收到错误消息。
botocore.exceptions.ClientError: An error occurred (NotAuthorizedException) when calling the SignUp operation: Unable to verify secret hash for client xxx
最佳答案
不知道这是否有帮助,但如果您使用的是 JavaScript SDK,则在设置第 1 部分中,它指出:
为您的用户群创建一个应用程序。请注意,必须取消选中生成客户端密码框,因为 JavaScript SDK 不支持具有客户端密码的应用。
我在没有生成客户端 key 的情况下创建了另一个应用程序并且它有效。
关于amazon-cognito - secret 哈希 : Amazon Cognito,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36938788/