[英]AWS Cognito Unable to verify secret hash for client
When I try to authenticateUser
I get 当我尝试
authenticateUser
我得到了
Error: Unable to verify secret hash for client <CLIENT_ID_HERE>
Whats wrong? 怎么了? My code below:
我的代码如下:
import {
Config,
CognitoIdentityCredentials
} from "aws-sdk"
import {
CognitoUserPool,
CognitoUserAttribute,
AuthenticationDetails,
CognitoUser
} from "amazon-cognito-identity-js"
Config.region = "ap-northeast-2"
var userpool = new CognitoUserPool({
UserPoolId: "ap-northeast-2_QosOiWMkd",
ClientId: "1bd6s9mv98bo2lucen2vesbqls"
})
var userData = {
Username: "jiewmeng@gmail.com",
Pool: userpool
}
var authData = new AuthenticationDetails({
Username: "jiewmeng@gmail.com",
Password: "P@$$w0rd"
})
var cognitoUser = new CognitoUser(userData)
cognitoUser.authenticateUser(authData, {
onSuccess: function (result) {
console.log("authenticated with", result)
},
onFailure: function (err) {
console.error(err)
}
})
On AWS, Client secret is already disabled 在AWS上,客户端密钥已被禁用
The Amazon Cognito Identity SDK for JavaScript does not support Apps with client secret. 适用于JavaScript的Amazon Cognito Identity SDK不支持具有客户端密钥的应用程序。 This is stated in the SDK documentation :
这在SDK文档中说明 :
When creating the App, the generate client secret box must be unchecked because the JavaScript SDK doesn't support apps that have a client secret.
创建应用程序时,必须取消选中生成客户端密码框,因为JavaScript SDK不支持具有客户端密钥的应用程序。
It looks like you are going to have to re-configure your app. 看起来您将不得不重新配置您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.