Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,15 @@ func (proxy *ProxyClient) IssueUserCertsWithMFA(ctx context.Context, params Reis
return nil, trace.Wrap(MFARequiredUnknown(err))
}
if !check.Required {
return nil, trace.Wrap(services.ErrSessionMFANotRequired)
log.Debug("MFA not required for access.")
// MFA is not required.
// SSH certs can be used without embedding the node name.
if params.usage() == proto.UserCertsRequest_SSH && key.Cert != nil {
return key, nil
}
// All other targets need their name embedded in the cert for routing,
// fall back to non-MFA reissue.
return proxy.reissueUserCerts(ctx, CertCacheKeep, params)
Comment on lines -545 to +553
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now matches the behavior on branch/v13 and master:

if !requiredCheck.Required {
log.Debug("MFA not required for access.")
// MFA is not required.
// SSH certs can be used without embedding the node name.
if params.usage() == proto.UserCertsRequest_SSH && key.Cert != nil {
return key, nil
}
// All other targets need their name embedded in the cert for routing,
// fall back to non-MFA reissue.
return proxy.reissueUserCerts(ctx, CertCacheKeep, params)
}

}
case proto.MFARequired_MFA_REQUIRED_YES:
// Proceed with the prompt for MFA below.
Expand Down