aws-sdk-android
aws-sdk-android copied to clipboard
Cognito ConfirmSignUp api doesn't expose the forcedAliasCreation property
We need to call the confirmSignUp
api but there is no public method exposing this property and the value of it is hardcoded to false
. Can we expose a method to have the ability to set this to true
.
https://github.com/aws-amplify/aws-sdk-android/blob/9134f0b64d2698f69ab6f3db568e6318ce6d43b7/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUser.java#L300
Thank you for your report. I have recorded as an enhancement that we need to make to our confirmSignUp method.
@zerox92 I'm a bit confused here. The method linked is public and takes in a forcedAliasCreation
boolean. There is no default set? Are you referring to Amplify not being able to set forcedAliasCreation
?
I understand that you may have been trying to get to this method from AWSMobileClient, which does not expose its created userpool. You should be able to directly hit this method using a snippet as shown below.
Note: If your awsconfiguration.json file is not stored in the default location, you would have to customize how AWSConfiguration
is instantiated.
// Snippet should be run on a worker thread, otherwise you will get networking on main thread exception
val userpool = CognitoUserPool(this, AWSConfiguration(this))
userpool.getUser("username").confirmSignUp(
"challengeResponse",
true,
clientMetadata,
object : GenericHandler {
override fun onSuccess() {
// handle success
}
override fun onFailure(exception: Exception) {
// handle failure
}
}
)