-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Pass the launched extra when resuming WebAuthenticator #30583
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
Conversation
Sometimes the intermediate activity is finished prematurely and state is lost. By passing the flag directly when resuming we never even need to keep the intermediate activity around. Fixes #24692
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the web authentication flow on Android to propagate the launched flag when resuming from the callback activity, ensuring the intermediate activity knows it should handle a callback rather than start a new auth session.
- Renamed and exposed extras constants (
LaunchedExtraandActualIntentExtra) tointernaland PascalCase. - Updated usages of those constants throughout the intermediate activity.
- Added a
PutExtrafor theLaunchedExtraflag in the callback activity.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Essentials/src/WebAuthenticator/WebAuthenticatorIntermediateActivity.android.cs | Renamed extras constants to LaunchedExtra/ActualIntentExtra and updated references. |
| src/Essentials/src/WebAuthenticator/WebAuthenticatorCallbackActivity.android.cs | Added PutExtra for LaunchedExtra when restarting the intermediate activity. |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Sometimes the intermediate activity is finished prematurely and state is lost. By passing the flag directly when resuming we never even need to keep the intermediate activity around.
I am not sure why the activity is finished in some cases, but it may be memory pressure or the OS decides it can. Either way, the only extras we care about is the launched flag. This is set to true to indicate that it has already launched, and then we can just resume the auth and finish.
If you get here and it is NOT launched and the activity is cleaned up, then something else has gone wrong as this activity is only start directly from maui auth with extras, or resumed from app code. It is not an exported activity and cannot be launched from outside the app.
Issues Fixed
Fixes #24692