Skip to content

Conversation

@ahibrahimleague
Copy link
Contributor

@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
Contributor Author

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

@pmathew92
Copy link
Contributor

Hi @ahibrahimleague Apologies for the delay, will plan to merge this with the next Android release

@pmathew92
Copy link
Contributor

Hi @ahibrahimleague ,
Could you fix this lint error
https://github.com/auth0/Auth0.Android/actions/runs/13234150006/job/36936476243?pr=784
Also could you share a video for reproducing the issue on sample app ?
Thank you for this contribution.

@ahibrahimleague
Copy link
Contributor Author

@pmathew92 I fixed the lint issue, also please find the before and after videos:

Before

auth0_reproducer_no_fix.mp4

After

auth0_with_fix.mp4

pmathew92
pmathew92 previously approved these changes Feb 10, 2025
@pmathew92
Copy link
Contributor

Hi @ahibrahimleague , I have approved the PR . We require all commits to be signed before we can merge them. Could you please sign your commits ? Once signed, I will merge this for our next release

@ahibrahimleague ahibrahimleague force-pushed the process_death_support_v3 branch from e4d1db9 to c4c52ac Compare February 10, 2025 20:10
@ahibrahimleague ahibrahimleague force-pushed the process_death_support_v3 branch 2 times, most recently from 98166b1 to 7423543 Compare February 10, 2025 20:25
@ahibrahimleague
Copy link
Contributor Author

@pmathew92 I had to do a rebase and force push to be able to sign the commits. Can you please approve the workflow, once it passes, approve the PR itself? Thanks!

@pmathew92 pmathew92 merged commit b9bfe0a into auth0:main Feb 11, 2025
9 checks passed
@pmathew92 pmathew92 mentioned this pull request Feb 13, 2025
@ahibrahimleague ahibrahimleague deleted the process_death_support_v3 branch April 20, 2025 13:20
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