Skip to content

Separate device login path from the normal login by using separate URL (v1.2.0) #300

@christiaangoossens

Description

@christiaangoossens

Device login should probably use its own URL instead of always showing when logging in.

Use fixed /auth/oidc/device path, show path automatically on the mobile sign-in screen with button to go to native browser (Android only). Remove finish path from the desktop login and automatically go back instead of requiring user button press.

Fixes #289
Fixes #288

===

Original question:

Would it be possible to display a button on the login page in the Companion App which opens the SSO page in the default browser (for example Firefox/Chrome) on Android?
Or if not, it would be great if at least the URL they need to visit manually was displayed somewhere in the Companion App with a button to copy the URL and instruction on what to do next.
Perhaps the copied URL could also contain the pairing code.

Right now, the message Please login to Home Assistant on another device would not be clear enough for most of my family members, since they don't even remember the URL of my Home Assistant instance (they don't need to, because of the automatic instance discovery in my LAN).

Right now the UI looks like this:
image

My suggestion would look somewhat like:

To sign in, please visit the Home Assistant login URL in a web browser:
https://example.com/auth/oidc/redirect/123456 [copy]

Enter this code when asked:
123456

Perhaps the pairing code does not need to be visible in the displayed URL, but could appear in the copied URL or in the link's href field. This would slightly reduce the risk of a typo when manually entering the URL in a web browser, while speeding up authentication if the URL is copied/the link is clicked. The URL could also be shortened, for example /mobile/123456, /mobile-login/12345. You can think of it like the OAuth2.0 device flow:

image

I think that the URL should probably be automatically generated for most users, but it should be possible to specify a custom URL template, because for example some instances might be behind a proxy with redirects.

Originally posted by @dominik-korsa in #288 (comment)

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions