Improve per-session MFA in a desktop session#52790
Merged
Conversation
gzdunek
commented
Mar 5, 2025
zmb3
approved these changes
Mar 5, 2025
Collaborator
zmb3
left a comment
There was a problem hiding this comment.
LGTM, please make sure we do some spot checks with per-session MFA for SSH and Kube as well.
Joerger
approved these changes
Mar 5, 2025
# Conflicts: # web/packages/teleport/src/DesktopSession/DesktopSession.tsx
Contributor
Author
I tested SSH, Kube and DBs in Web UI, they all display an error message if the user doesn't have a supported MFA method available. |
gzdunek
added a commit
that referenced
this pull request
Mar 7, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
gzdunek
added a commit
that referenced
this pull request
Mar 10, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
gzdunek
added a commit
that referenced
this pull request
Mar 10, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
This was referenced Mar 10, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 17, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 17, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 18, 2025
* Do not try to send an empty MFA challenge in a desktop session * Prevent a runtime error when neither a challenge nor a request is present * Do not overwrite MFA errors with a custom message, show an error when the MFA dialog is closed * Fix a test so that either a request or a challenge is passed * Desktop Access -> Desktop access * Reduce nesting (cherry picked from commit 522bd4e)
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.
This PR fixes two bugs:
If no WebAuthn MFA device is added, the UI gets stuck on a desktop loading screen indefinitely. Under the hood we receive
"webauthn_challenge":null,"totp_challenge":false,"sso_challenge":null, which causes a runtime error inuseMfa. To prevent this, I added a backend check to ensure empty challenges are not sent for desktop sessions (inspired by a similar check for SSH sessions). This is how it looks:If you close the MFA dialog, you end up on a loading screen. This happened because the cancelation error wasn't handled. Now, the error is displayed using our Alert component:

changelog: Web UI now properly shows per-session MFA errors in desktop sessions