When I try authenticateUser , I get
Error: Unable to verify secret hash for client <CLIENT_ID_HERE>
What's wrong? My code is 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) } })
AWS has already disabled client secret

source share