Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cognito ConfirmSignUp api doesn't expose the forcedAliasCreation property #3430

Open
zerox92 opened this issue Oct 13, 2023 · 3 comments
Open
Labels
cognito Issues with the AWS Android SDK for Cognito feature-request Request a new feature

Comments

@zerox92
Copy link

zerox92 commented Oct 13, 2023

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.

confirmSignUp(confirmationCode, forcedAliasCreation, Collections.<String, String>emptyMap(), callback);

@gpanshu gpanshu added feature-request Request a new feature cognito Issues with the AWS Android SDK for Cognito labels Oct 13, 2023
@gpanshu
Copy link
Contributor

gpanshu commented Oct 13, 2023

Thank you for your report. I have recorded as an enhancement that we need to make to our confirmSignUp method.

@tylerjroach
Copy link
Contributor

@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?

@tylerjroach
Copy link
Contributor

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
        }
    }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cognito Issues with the AWS Android SDK for Cognito feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

3 participants