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

Browser selection #1565

Open
Valair opened this issue Sep 11, 2021 · 2 comments
Open

Browser selection #1565

Valair opened this issue Sep 11, 2021 · 2 comments
Labels
Enhancement This is a feature request to add functionality that is not currently supported

Comments

@Valair
Copy link

Valair commented Sep 11, 2021

We are experiencing an issue where the BrowserSelector.getAllBrowsers seems to pick only the phone default browser.

The documentation suggests to avoid authorization_user_agent WEBVIEW, in fact following the suggested best practice for mobile Google does not allow logging in using webview agent, but if the user has a supported browser installed (e.g. Chrome) and the default one isn't in the supported list (e.g. Mi Browser), the library:

The only workaround we found is to manually change the default browser to a supported one.

Modifying the BrowserSelector.getAllBrowsers method and the BROWSE_INTENT to match the AppAuth library (which it is working in another project) seem to solve the problem and the library is able to use a supported browser even if it's not the default one.

Reading the authorization_user_agent documentation, it seems that this is the intended behavior for value BROWSER, but not for DEFAULT.

Am I missing something to allow the library to check for all installed browsers?
I think a more user-friendly behavior should be to be able to use a supported browser if it is installed and the default one isn't supported, rather than forcing the user to change his/her default browser.

@paulkagiri
Copy link
Contributor

Hello @Valair, are you still experiencing this?

@Valair
Copy link
Author

Valair commented Oct 15, 2021

Hi @paulkagiri , yes I've updated to msal-android-library@2.2.1, which uses common@3.6.2, but the issue remains.

Example scenario
Installed browsers:

  • Chrome
  • Mi Browser
  • Firefox
  • Brave

If the default system browser is Mi Browser or Brave, using authorization_user_agent DEFAULT cause the webview to be opened (so the user is unable to login with a google account), while setting it to BROWSER cause the missing browser error.
Changing the default system browser to Chrome or Firefox the library works as expected.

As a workaround, I'm currently using a custom version of this library with a modified version of the BrowserSelector.getAllBrowsers.

@paulkagiri paulkagiri added the Enhancement This is a feature request to add functionality that is not currently supported label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a feature request to add functionality that is not currently supported
Projects
None yet
Development

No branches or pull requests

2 participants