简体   繁体   English

AWS Cognito无法验证客户端的秘密哈希值

[英]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.

相关问题 如何检查或验证用户是否使用 AWS Cognito Javascript 登录? - How can I check or verify that a user is signed in with AWS Cognito Javascript? AWS Cognito Admin创建的用户临时密码验证并重置 - AWS Cognito Admin created user temp password verify & reset 如何验证 paytm 客户端 ID 和密钥是否有效? - how to verify whether paytm client id and secret key are valid ones? AWS Cognito:更改 aws_user_pools_web_client_id - AWS Cognito: changing the aws_user_pools_web_client_id 从AWS Cognito检索访问令牌,秘密访问密钥和会话令牌 - Retrieve the access token, secret access key and session token from aws cognito 使用 Cognito 用户池向 AWS AppSync 验证 Apollo 客户端 - Authenticate Apollo Client to AWS AppSync with Cognito User Pools 无法使用 aws-amplify 从 cognito 获取更新的属性及其值 - Unable to get updated attributes and their values from cognito with aws-amplify AWS Cognito无法进行身份验证:空白答案-JS SDK - AWS Cognito Unable to authenticate : blank answer - JS SDK 无法使用 AWS Lambda 服务从 AWS cognito 获取用户信息 - Unable to fetch user information from AWS cognito using AWS Lambda service UNABLE_TO_VERIFY_LEAF_SIGNATURE k8s Javascript 客户端 - UNABLE_TO_VERIFY_LEAF_SIGNATURE k8s Javascript client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM