Deny login early when offline and force_provider_authentication set#1356
Draft
Deny login early when offline and force_provider_authentication set#1356
force_provider_authentication set#1356Conversation
The error message from `err` can be quite long, making it hard to
distinguish where it ends:
Could not connect to the provider: Get "https://login.microsoftonline.com/03c73201-ef9e-4182-ae04-0adb51f4a0b6/v2.0/.well-known/openid-configuration": dial tcp: lookup login.microsoftonline.com on 127.0.0.53:53: server misbehaving. Starting session in offline mode.
Let's move the "starting session in offline mode" part before the error
message to make it more visible and to make clear that it does not
belong the message of the connection error.
When the session is offline and force_provider_authentication is set, we still used to ask the user for the local password, and only when the correct local password was entered we returned an error. Let's improve UX by failing early in that case, before asking for a password. Also improves the error message a bit. Note that, if sshd is configured to allow login with authd, this leaks the information if the host can reach the provider or not to anyone try to connect via SSH. However, that is already the case, since users can "go back" and check if device authentication is offered or not.
Avoid prepending unhelpful information to the error message displayed to
the user.
The old message was:
could not create new session for user "test@ubudev1.onmicrosoft.com": Error connecting to provider. Check your network connection.
The new message is:
Error connecting to provider. Check your network connection.
In the one other case where this function returns an error, we now
prepend the error with a description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the session is offline and
force_provider_authenticationis set, we still used to ask the user for the local password, and only when the correct local password was entered we returned an error.Let's improve UX by failing early in that case, before asking for a password. Also improves the error message a bit.
UDENG-9481