Cognito login works fine but getting 400 error in browser

Discussão em 'Angular' iniciado por Nathan Parrett, Dezembro 25, 2024.

  1. strange one this, I am using angular 7 and using API gateway with authentication.

    My problem is that on both using amplify and amazon-cognito-identity-js I get a 400 error in the browser. All works fine but the error persists.

    See below:-

    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 =>
    {});


    In the browser I get :-

    POST https://cognito-idp.eu-west-1.amazonaws.com/ 400 error

    However, the code works, any idea why this could be happening?

    Thanks for your help

    Continue reading...

Compartilhe esta Página