Skip to content

Commit

Permalink
Merge branch 'joerger/connect-allow-sso-redirect-url' into joerger/ss…
Browse files Browse the repository at this point in the history
…o-mfa-connect-base
  • Loading branch information
Joerger committed Nov 4, 2024
2 parents 0af2ba6 + 21840be commit 9a60a6b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/teleterm/clusters/cluster_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ func (c *Cluster) LocalLogin(ctx context.Context, user, password, otpToken strin

// SSOLogin logs in a user to the Teleport cluster using supported SSO provider
func (c *Cluster) SSOLogin(ctx context.Context, providerType, providerName string) error {
// Get the ping response for the given auth connector.
c.clusterClient.AuthConnector = providerName

if _, err := c.updateClientFromPingResponse(ctx); err != nil {
return trace.Wrap(err)
}

c.clusterClient.AuthConnector = providerName

if err := c.login(ctx, c.ssoLogin(providerType, providerName)); err != nil {
return trace.Wrap(err)
}
Expand All @@ -115,12 +116,13 @@ func (c *Cluster) SSOLogin(ctx context.Context, providerType, providerName strin

// PasswordlessLogin processes passwordless logins for this cluster.
func (c *Cluster) PasswordlessLogin(ctx context.Context, stream api.TerminalService_LoginPasswordlessServer) error {
// Get the ping response for the given auth connector.
c.clusterClient.AuthConnector = constants.PasswordlessConnector

if _, err := c.updateClientFromPingResponse(ctx); err != nil {
return trace.Wrap(err)
}

c.clusterClient.AuthConnector = constants.PasswordlessConnector

if err := c.login(ctx, c.passwordlessLogin(stream)); err != nil {
return trace.Wrap(err)
}
Expand Down

0 comments on commit 9a60a6b

Please sign in to comment.