Skip to content

Commit

Permalink
Increase SSO callback timeout to 180 seconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
russjones committed Feb 4, 2019
1 parent c6464a7 commit d409ee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/client/weblogin.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (

"github.com/gravitational/teleport"
"github.com/gravitational/teleport/lib/auth"
"github.com/gravitational/teleport/lib/defaults"

"github.com/gravitational/roundtrip"
"github.com/gravitational/trace"
Expand Down Expand Up @@ -276,8 +277,8 @@ func SSHAgentSSOLogin(ctx context.Context, proxyAddr, connectorID string, pubKey
case response := <-waitC:
log.Debugf("Got response from browser.")
return response, nil
case <-time.After(60 * time.Second):
log.Debugf("Timed out waiting for callback.")
case <-time.After(defaults.CallbackTimeout):
log.Debugf("Timed out waiting for callback after %v.", defaults.CallbackTimeout)
return nil, trace.Wrap(trace.Errorf("timed out waiting for callback"))
case <-ctx.Done():
log.Debugf("Canceled by user.")
Expand Down
4 changes: 4 additions & 0 deletions lib/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ const (
// AnyAddress is used to refer to the non-routable meta-address used to
// refer to all addresses on the machine.
AnyAddress = "0.0.0.0"

// CallbackTimeout is how long to wait for a response from SSO provider
// before timeout.
CallbackTimeout = 180 * time.Second
)

var (
Expand Down

0 comments on commit d409ee0

Please sign in to comment.