Skip to content

NotAuthorizedException Incorrect username or password amazon-cognito-identity-js

I have been able to log in and log out for a while with the exact same email and password combination. However, now, every time I try to log in (I tried the following cases: disabled my user on the console, reset my users passcode on the console) I get the error:NotAuthorizedException: Incorrect username or password.

To check if I am just not remembering right, I created a NEW user. The user now has the status FORCE_CHANGE_PASSWORD on the console. However, my console is logging the same error, not authorized. Can anyone help me out?

Answer

I rolled back some of my work to when it was working. The issue appears that instead of feeding the username and passcode directly to the authentication device, I was passing it through as an object which resulted in the Cognito sdk not receiving a user passcode pair it could parse correctly.