Skip to content

[v16] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133)#57160

Merged
okraport merged 1 commit intobranch/v16from
okraport/backport-57133-branch/v16
Jul 25, 2025
Merged

[v16] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133)#57160
okraport merged 1 commit intobranch/v16from
okraport/backport-57133-branch/v16

Conversation

@okraport
Copy link
Copy Markdown
Contributor

Backport #57133 to branch/v16

changelog: Fixed fallback for web login when second factor is set to on but only OTP is configured.

* Add OTP fallback for SSHAgentMFAWebSessionLogin

In the case Teleport `second_factor` is set to `on`,
it is possible for a user to only have OTP configured.
Prior to this commit this would result in a auth fail
as the created challenge only supported TOTP.

Server side would recieve an incomplete `AuthenticateWebUserRequest`
object, which fails validation via `CheckAndSetDefaults` and
as such only a failed login audit event was emitted with no
additional logs.

This mode of failure can be reproduced with
`tsh bench -d web sessions --auth=local`.

changelog: Fixed fallback for web login when second factor is set to `on` but only OTP is configured.

* improve errors for unsupported web login mfa challenge

* Update lib/client/weblogin.go

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Update lib/client/weblogin.go

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* unexport SSHAgentMFAWebSessionLogin and SSHAgentLoginWeb

* update sshAgentLoginWebCreateSession signature

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
@github-actions github-actions bot requested a review from espadolini July 25, 2025 08:35
@github-actions github-actions bot requested a review from rosstimothy July 25, 2025 08:35
@okraport okraport changed the title Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133) [v16] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133) Jul 25, 2025
@okraport okraport enabled auto-merge July 25, 2025 09:27
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from rosstimothy July 25, 2025 10:04
@okraport okraport added this pull request to the merge queue Jul 25, 2025
Merged via the queue into branch/v16 with commit 83cb8c2 Jul 25, 2025
41 checks passed
@okraport okraport deleted the okraport/backport-57133-branch/v16 branch July 25, 2025 10:23
@fheinecke fheinecke mentioned this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants