Skip to content

Allows support for other default browsers on Android to work with the Web Authenticator#15278

Closed
vhugogarcia wants to merge 1 commit intodotnet:mainfrom
vhugogarcia:essentials-webauthenticator-android-default-browser
Closed

Allows support for other default browsers on Android to work with the Web Authenticator#15278
vhugogarcia wants to merge 1 commit intodotnet:mainfrom
vhugogarcia:essentials-webauthenticator-android-default-browser

Conversation

@vhugogarcia
Copy link
Copy Markdown
Contributor

@vhugogarcia vhugogarcia commented May 25, 2023

Description of Change

When a browser different from Chrome is assigned as default in Android, the web authenticator throws an exception with some browsers only.
This change prevents NullReferenceException on WebAuthenticatorIntermediateActivity.android.cs and allows support for other default browsers on Android to work with the Web Authenticator, and continue the authentication flow.

This change has been tested with the following browsers:

  • Firefox,
  • Microsoft Edge
  • Chrome
  • DuckDuckGo
  • Mi Browser
  • Samsung Internet
  • Opera
  • Brave.

Important: *Due to a browser limitation, some browsers do not support Android CustomTabs feature to get back to the app automatically, so, the user must manually hit the back button or open again the app (Opera and Mi Browser). This is something that cannot be managed in .NET MAUI.

Issues Fixed

Fixes #13798

@ghost ghost added the community ✨ Community Contribution label May 25, 2023
@ghost
Copy link
Copy Markdown

ghost commented May 25, 2023

Hey there @vhugogarcia! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label May 25, 2023
base.OnResume();

if (!launched)
if (actualIntent != null && !launched)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (actualIntent != null && !launched)
if (actualIntent is not null && !launched)

@mattleibow
Copy link
Copy Markdown
Member

Thanks for this PR - we actually found a bigger issue. Using the system browser should NOT trigger the intermediate activity at all. @Redth fixed the root in #15187

@mattleibow mattleibow closed this May 26, 2023
@vhugogarcia
Copy link
Copy Markdown
Contributor Author

Thanks @mattleibow for the heads-up. Happy to see it has been fixed fully. Please back-port that issue to .NET MAUI 7 service release. We are facing this issue with our apps and it will be good 🙏 to have it fix.

Thanks again 😎

@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info community ✨ Community Contribution platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preventing NullReferenceException on WebAuthenticatorIntermediateActivity

5 participants