We are trying to migrate the Cognito user pool in our system. To do this, we do need to use "USER_PASSWORD" AuthenticationType, as explained here:
Your app sends the username and password to Amazon Cognito. If your app has a native sign-in
UI and uses the Cognito Identity Provider SDK, your app must use the USER_PASSWORD_AUTH
flow, in which the SDK sends the password to the server (your app must not use the
default USER_SRP_AUTH flow since the SDK does not send the password to the server
in the SRP authentication flow). The USER_PASSWORD_AUTH flow is enabled by setting
AuthenticationDetails.authenticationType to "USER_PASSWORD".
The Cognito documentation does not explain how to do this.
This thread states we need to use android-sdk-cognitoidentityprovider SDK in order to specify the AuthenticationType.
Could you please refer me to one example or code snipped on how to implement this use case using the aforementioned SDK? I can't understand how to do this with the javadoc documentation referred - The javadocs explain how to build one AuthenticationDetails object with the desired authentication type, but I don't know what to do with it.
How could I effectively start the authentication flow with the manually constructed AuthenticationDetails?
Our app is currently using the Amplitude SDK extensively for sign-in and authentication features.
If we use android-sdk-cognitoidentityprovider to sign in with "USER_PASSWORD", will the existing code be compatible with it?
For example, will the app be able to get the id tokens using AwsMobileClient.getTokens(), will the automatic refreshment of expired tokens work, and will the "reset forgotten password" use case work?
I'm using:
com.amazonaws:aws-android-sdk-mobile-client:2.16.10
com.amazonaws:aws-android-sdk-s3:2.16.10
com.amazonaws:aws-android-sdk-cognitoauth:2.16.10