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

Support Process Death in WebAuthProvider #784

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahibrahimleague
Copy link

@ahibrahimleague ahibrahimleague commented Dec 3, 2024

Changes

This PR fixes issue #779, where Auth0 fails to invoke the registered callbacks due to losing the callbacks that were registered when calling await() or start().

This was achieved by serializing the Auth0Manager state into JSON and saving this JSON into the AuthorizationActivity bundle. When restoration happens, we rebuild the Auth0Manager again from the already saved bundle.

In order though to receive the callbacks from the newly restored OAuthManager, we need to listen to the callbacks through an application-scoped callback, so I've added a couple of new APIs called addCallback and removeCallback (open for naming and redesign changes) that clients if interested, they can call add/removeCallback from onStart and onStop, so that when the oauth authentication request's result returns, would get invoked with the captured credentials.

  • Added addCallback and removeCallback to WebAuthProvider.
  • Updated the sample app with the new API.

References

Testing

Add tests for the serializing and deserializing logic.

  • This change adds unit test coverage

  • This change adds integration test coverage

  • This change has been tested on the latest version of the platform/language or why not

Checklist

@ahibrahimleague ahibrahimleague requested a review from a team as a code owner December 3, 2024 11:04
@pmathew92
Copy link
Contributor

@ahibrahimleague Thank you for raising this PR. Will review this and check if we can include this in any of our coming releases

@ahibrahimleague
Copy link
Author

Hello @pmathew92, have you had the chance to look into this? wondering about the outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants