Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase SSO callback timeout to 180 seconds. #2533

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
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
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