Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question AWS CognitoIdentity NotAuthorizedException: Incorrect username or password

Discussion in 'Authentication' started by LoopIssuer, Sep 18, 2022.

  1. LoopIssuer

    LoopIssuer

    Joined:
    Jan 27, 2020
    Posts:
    86
    Hi,
    After successful user registration, trying to Sign Up, but receive:
    NotAuthorizedException: Incorrect username or password

    Debug shows that all AWS Cognito 'challenge' steps seem to be successful, except last: CognitoIDPClient.RespondToAuthChallengeAsync

    I attach the used script (credits to: http://www.gradientspace.com/tutorials/2018/1/25/using-aws-cognito-user-accounts-with-unity).

    Please tell me, what could be the reason - is it a Unity or AWS issue, or maybe sth is wrong in the script?
     

    Attached Files:

  2. saadk_unity

    saadk_unity

    Unity Technologies

    Joined:
    Oct 15, 2021
    Posts:
    6
    Hello!

    Apologies for the delayed response, it seems like this is a setup issue in the script using the AWS SDK.

    It looks like the authRequest in the TrySignInRequest function is missing the "Password" key value pair. You may also need to change the AuthFlowType to AuthFlowType.USER_PASSWORD_AUTH based on the setup.

    Hope that helps!