Search code examples
amazon-web-serviceskotlinaws-amplify

AWS Amplify how to check if the password is correct during authentication?


I am implementing a simple sign-up sign-in system in my Android app using AWS Amplify and Kotlin. Everything seems to work fine except for one thing that when the user tries to sign-in they can use any password to do so. If they type in a registered and confirmed username the successfully log in which is obviously not what I want. I want them to type in the correct password as well. Do I need to change something in my AWS User Pool settings to achieve this or do I handle this in Kotlin somehow?

Amplify.Auth.signIn(inputEmail.text.toString(), inputPassword.text.toString(), {}, {})

Solution

  • I found the error. AWS Amplify keeps a cached version of the previous successful login which is prioritized over the current attempted login. So at some point I have to call Amplify.Auth.signOut()