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

Enable custom auth flow on demand #1488

Closed
cyn-ph opened this issue Feb 25, 2020 · 10 comments
Closed

Enable custom auth flow on demand #1488

cyn-ph opened this issue Feb 25, 2020 · 10 comments
Labels
cognito Issues with the AWS Android SDK for Cognito mobile client Issues with AWS Mobile's client-side Cognito wrapper question General question

Comments

@cyn-ph
Copy link

cyn-ph commented Feb 25, 2020

State your question
Our default configuration in the config file is set to use OAuth, we use this to handle most of the authentication flows on our app, however we provide a password less flow that needs to be handled using custom auth. The problem is that if I initialise the client with custom auth flows enabled, regular OAuth flows won't work and if I initialise the client with out custom auth our password less flow always triggers and exception:

NoAuthorizedException: Incorrect username or password

My question then is: is possible to enable/disable custom auth flow on demand and if so, how? Or re-initialise the client so it will load the desired config?

Which AWS Services are you utilizing?
Cognito User Pools through the AWSMobileClient

Device Information (please complete the following information):

  • Device: Pixel 3
  • Android Version: Android 10
  • Specific to simulators: No

Environment (please complete the following information):
SDK Version: 2.16.7

@cyn-ph
Copy link
Author

cyn-ph commented Mar 9, 2020

Is there any update on this one?

@jamesonwilliams jamesonwilliams added mobile client Issues with AWS Mobile's client-side Cognito wrapper cognito Issues with the AWS Android SDK for Cognito question General question labels Mar 9, 2020
@TrekSoft
Copy link
Contributor

There is not a way to enable/disable custom auth after initialization and there's currently no way to reinitialize AWSMobileClient while the app is running.

It sounds like you know how to initialize it differently for the different flows on startup, correct? You're just asking if you can change from Oauth to custom during runtime? If so, currently not.

@cyn-ph
Copy link
Author

cyn-ph commented Mar 28, 2020

Yes, and that is what we are doing at the moment (initialise the client depending on the flow) but there is a case that is giving us trouble:

  • User try to use social log in (we are using hosted UI to present) the UI before showing the hosted UI I need to initialise with OAuth
  • Our data suggests that people decide not to continue with this option and right after try to use the password less flow (which requieres Custom Auth)
  • At this point we are not able to re-initialise to be able to use Custom Auth unless the user kills the app

Do you know any work around?

@TrekSoft
Copy link
Contributor

Yeah sadly not at this time - we are working on an improved auth API at the moment and will consider this issue during the design of that.

@cyn-ph
Copy link
Author

cyn-ph commented Jun 17, 2020

Hi @TrekSoft, any news on this issue? I know you recently launched the Amplify sdk and I was wondering if this is something you took into consideration there or if new versions of the AWSMobile SDK provides a fix?

@TrekSoft
Copy link
Contributor

Hey, yeah the new Amplify Auth category doesn't support this yet but we have an open feature request here to support reconfiguration: aws-amplify/amplify-android#560

@cyn-ph
Copy link
Author

cyn-ph commented Jun 17, 2020

And will it be only available on Amplify? or will the feature be available on AWS SDK as well?

@TrekSoft
Copy link
Contributor

Yeah I don't know of any plan to enable that on AWSMobileClient - just Amplify.

@sp00ne
Copy link

sp00ne commented Jan 8, 2021

I honestly am a bit flabbergasted at the fact that there is no account of supporting all of the authentication types.

@Svedenmark
Copy link

Hi @TrekSoft can you please confirm that the issue above is fixed in Amplify?

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 mobile client Issues with AWS Mobile's client-side Cognito wrapper question General question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants