奇怪的是,我正在使用angular 7并使用具有身份验证的API网关。
我的问题是,在同时使用amplify和amazon-cognito-identity-js时,浏览器出现400错误。一切正常,但错误仍然存在。
请参见下文:-
Auth.configure({
mandatorySignIn: false,
// REQUIRED - Amazon Cognito Identity Pool ID
identityPoolId: 'eu-west-1:ssssssssssss',
// REQUIRED - Amazon Cognito Region
region: 'eu-west-1',
// OPTIONAL - Amazon Cognito User Pool ID
userPoolId: 'eu-west-1_ssssssssssss',
// OPTIONAL - Amazon Cognito Web Client ID (26-char alphanumeric string)
userPoolWebClientId: 'sssssssss',
})
const user = Auth.signIn(userName, password).then(res =>
{});
在浏览器中,我得到:-
POST https://cognito-idp.eu-west-1.amazonaws.com/ 400错误
但是,代码可以正常工作,知道为什么会发生这种情况吗?
感谢您的帮助