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

Open external URLs in default browser #75

Closed
Kisty opened this issue Nov 26, 2019 · 6 comments · Fixed by #236
Closed

Open external URLs in default browser #75

Kisty opened this issue Nov 26, 2019 · 6 comments · Fixed by #236
Labels
enhancement New feature or request
Projects

Comments

@Kisty
Copy link
Contributor

Kisty commented Nov 26, 2019

Would be good to perhaps get the app to open external links in the browser. I managed to get back to log in by pressing back which logged me out of HA :(.

This can be done by using shouldOverrideUrlLoading.

The only issue I can see about this is that there might be instances where you want authenticate using the HA OAuth for account linking or possibly other things.

@balloob
Copy link
Member

balloob commented Nov 26, 2019

OAuth account linking should work just fine in an external browser, as the authorize callback endpoints do not require authentication.

@balloob balloob added the enhancement New feature or request label Dec 3, 2019
@balloob balloob added this to ToDo in Android Dec 3, 2019
@fanaticDavid
Copy link

fanaticDavid commented Dec 7, 2019

I have my Home Assistant instance running behind an NGINX reverse proxy. To add an extra layer of security, I set up NGINX to use Google OAuth. When I manually enter the external URL to reach my HA instance, it shows me the "Sign in with Google" button (as it should) but when I tap that, I get a 403 error: disallowed_useragent

Would this enhancement fix that problem?

@balloob
Copy link
Member

balloob commented Dec 7, 2019

@fanaticDavid that is a duplicate of #45

@ve6rah
Copy link

ve6rah commented Dec 22, 2019

As another data point, I have a weblink set up in HA that I click on that has its own authentication. Opening it in a browser allows me to enter username/password, however if I click the link from within the HA app it skips authentication and just goes straight to the not authorized error.

I'd love to see either the option to open these links in an external browser, or for the internal browser to support authenticated websites.

@jmiedzinski
Copy link

When I manually enter the external URL to reach my HA instance, it shows me the "Sign in with Google" button (as it should) but when I tap that, I get a 403 error: disallowed_useragent

This is because of:
As of April 20, 2017, Google has blocked OAuth authorization requests via web views. Unfortunately, a lot of developers have not migrated their current apps away from using embedded browsers to make such requests. Therefore, users trying to use their Google accounts to sign in to third party apps that still make use of web views for OAuth logins constantly get the dreaded 403 disallowed_useragent error.

More info here:
https://auth0.com/blog/google-blocks-oauth-requests-from-embedded-browsers/

I also stuck on this, so +1 for handling authentication in external browser

@gadgetchnnel
Copy link
Contributor

Another reason for this is links which can be opened in a native Android app, for example links to Reddit posts (I have a feed of these in HA). In the old PWA these will open in the Reddit app. In the new app they will open the Reddit site in the webview, and clicking the option to open in the app fails with net::ERR_UNKNOWN_URL_SCHEME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Android
  
Done
Development

Successfully merging a pull request may close this issue.

6 participants