Skip to content

[v17] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133)#57159

Merged
okraport merged 1 commit intobranch/v17from
okraport/backport-57133-branch/v17
Jul 25, 2025
Merged

[v17] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133)#57159
okraport merged 1 commit intobranch/v17from
okraport/backport-57133-branch/v17

Conversation

@okraport
Copy link
Copy Markdown
Contributor

Backport #57133 to branch/v17

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>
@okraport okraport changed the title Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133) [v17] Add OTP fallback for SSHAgentMFAWebSessionLogin (#57133) Jul 25, 2025
@okraport okraport enabled auto-merge July 25, 2025 09:28
@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/v17 with commit df16109 Jul 25, 2025
41 checks passed
@okraport okraport deleted the okraport/backport-57133-branch/v17 branch July 25, 2025 10:25
@doggydogworld doggydogworld mentioned this pull request Jul 28, 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