Skip to content

UnauthorizedErrors are not received in lock widget callbacks #606

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

Closed
udayakr opened this issue Feb 15, 2021 · 5 comments · Fixed by #618
Closed

UnauthorizedErrors are not received in lock widget callbacks #606

udayakr opened this issue Feb 15, 2021 · 5 comments · Fixed by #618
Labels
feature request A feature has been asked for or suggested by the community
Milestone

Comments

@udayakr
Copy link

udayakr commented Feb 15, 2021

We developed android application and its under beta testing. Here is the scenario which is failing.
When user has not verified email id and is trying to login via android app (uses auth0 lock widget). Lock widget is not recieving callbacks from the auth0 eventhough we have created a rule (Force email verification).
Hence our android app is not able to take user to corresponding screen (resend email verification screen

Describe the problem

We have creted "Force email verification" rule in auth0. When user whose email is not yet verified is trying to login via android lock widget to auth0, the callback is not called by passing UnauthorizedError object we are throwing in auth0 Rule

What was the expected behavior?

the callback should contain the UnauthorizedError object and that should be passed back to android lock widget

This functionality is working for IoS mobile lock widget and webclient (javascript using react js) lock widget.
This certainly looks to be an issue with handling errors in android lock widget code of auth0

@lbalmaceda
Copy link
Contributor

👋 @udayakr thanks for raising this. In case of a "rule error", what the library will do today is take the error message that you return from the rule code and display that in the orange toast that appears on the top. You could add a message like "email not verified" for the user to notice that.

Other errors that we also handle internally are invalid username/password, invalid mfa token, password not strong enough, user is blocked, etc. Think of those that today rely on this banner appearing showing the message they've defined from the rule code; that would no longer be shown and the exception would be raised through the callback and they would not be expecting that. As you may notice, a change in the way we handle errors could pose a breaking change for existing customers.

Lock libraries are meant to simplify these use cases and handle some of the errors the server returns. While I agree consistency across platforms is ideal, for the current major of this library, this change is not possible. You can always take Auth0.Android, the SDK this library uses internally, and customize your experience.

@lbalmaceda lbalmaceda added the waiting for customer This issue is waiting for a response from the issue or PR author label Feb 23, 2021
@udayakr
Copy link
Author

udayakr commented Feb 23, 2021

@lbalmaceda Thanks for your response. Can you tell me the file name which has source to customize for our requirements ?
is Auth0.Android is the filename ?

@lbalmaceda
Copy link
Contributor

This library (Lock.Android) makes use of the Auth0 SDK for android (Auth0.Android) to perform API calls. What I said above is that if you'd like this feature today, you can either:

a. Fork this repository (Lock.Android) and update it to handle the error to fit your specific use case. That would be something similar to what we do here to handle MFA errors. Note that there are 3 callback implementations: log in, sign up, and web authentication. Check which one would apply to your use case. Also, remember that if you fork the repository you are responsible for pulling the changes we will keep introducing to the library.

b. Construct your own UI and use the SDK (auth0.android) to make the API calls. You can find docs along with some snippets in the SDK repository. We also have quickstarts that explain the basic setup and web authentication.

I hope that helps.

@lbalmaceda lbalmaceda added feature request A feature has been asked for or suggested by the community and removed waiting for customer This issue is waiting for a response from the issue or PR author labels Apr 28, 2021
@lbalmaceda lbalmaceda added this to the Major - v3 milestone Apr 28, 2021
@lbalmaceda
Copy link
Contributor

This change will be available in the next major version which is actively being developed.

@lbalmaceda
Copy link
Contributor

Fixed with #618

@lbalmaceda lbalmaceda changed the title UnauthorizedErrors are not recieved in lock widget callsbacks UnauthorizedErrors are not received in lock widget callbacks May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants