Skip to content

Commit

Permalink
Fix conflicts for v9
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Apr 8, 2022
1 parent fbb5cb8 commit f4862e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions lib/client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ func (tc *TeleportClient) IssueUserCertsWithMFA(ctx context.Context, params Reis

key, err := proxyClient.IssueUserCertsWithMFA(ctx, params,
func(ctx context.Context, proxyAddr string, c *proto.MFAAuthenticateChallenge) (*proto.MFAAuthenticateResponse, error) {
return PromptMFAChallenge(ctx, proxyAddr, c, "", false)
return PromptMFAChallenge(ctx, c, proxyAddr, nil /* opts */)
})

return key, err
Expand Down Expand Up @@ -3069,8 +3069,9 @@ func (tc *TeleportClient) mfaLocalLogin(ctx context.Context, pub []byte) (*auth.
RouteToCluster: tc.SiteName,
KubernetesCluster: tc.KubernetesCluster,
},
User: tc.Config.Username,
Password: password,
User: tc.Username,
Password: password,
UseStrongestAuth: tc.UseStrongestAuth,
})

return response, trace.Wrap(err)
Expand Down
11 changes: 6 additions & 5 deletions lib/client/api_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,12 @@ func TestTeleportClient_Login_localMFALogin(t *testing.T) {
{
name: "Webauthn and UseStrongestAuth",
secondFactor: constants.SecondFactorOptional,
inputReader: prompt.NewFakeReader().
AddString(password).
AddReply(func(ctx context.Context) (string, error) {
panic("this should not be called")
}),
solveOTP: func(ctx context.Context) (string, error) {
panic("unused")
},
solveU2F: func(context.Context, string, ...u2flib.AuthenticateChallenge) (*u2flib.AuthenticateChallengeResponse, error) {
panic("unused")
},
solveWebauthn: solveWebauthn,
useStrongestAuth: true,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/client/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func PromptMFAChallenge(ctx context.Context, c *proto.MFAAuthenticateChallenge,
}

// Prompt only for the strongest auth method available?
if opts.UseStrongestAuth && hasWebauthn {
if opts.UseStrongestAuth && hasNonTOTP {
hasTOTP = false
}

Expand Down

0 comments on commit f4862e5

Please sign in to comment.