gravitational/teleport · error

err.Error()

Error message

err.Error()

What it means

In the SSO Redirector's HTTP handlers, this is a dynamic http.Error-style call that writes the handler's actual error string (err.Error()) to the response body when serving the short redirect URL fails; the message shown to the browser is whatever error the local server encountered.

Source

Thrown at lib/client/sso/redirector.go:307

	return nil
}

// clickableURL returns a short, clickable URL that will redirect
// the browser to the SSO redirect URL.
func (rd *Redirector) clickableURL(redirectURL, postForm string) string {
	// shortPath is a link-shortener path presented to the user
	// it is used to open up the browser window, notice
	// that redirectURL will be set later
	shortPath := "/" + uuid.New().String()

	// short path is a link-shortener style URL
	// that will redirect to the Teleport-Proxy supplied address
	rd.mux.HandleFunc(shortPath, func(w http.ResponseWriter, r *http.Request) {
		if postForm != "" {
			form, err := base64.StdEncoding.DecodeString(postForm)
			if err != nil {
				http.Error(w, err.Error(), trace.ErrorToCode(err))
				return
			}
			if err := saml.WriteSAMLPostRequestWithHeaders(w, form); err != nil {
				http.Error(w, err.Error(), trace.ErrorToCode(err))
				return
			}
		} else {
			http.Redirect(w, r, redirectURL, http.StatusFound)
			return
		}
	})

	return clickableURL(rd.baseURL() + shortPath)
}

// clickableURL fixes the address in a URL to make sure
// it's clickable, e.g. it replaces "undefined" addresses like
// 0.0.0.0 used in network listeners with the loopback address.

View on GitHub (pinned to 1283425b60)

Solutions

  1. Inspect the local proxy/tsh logs to identify the underlying error behind the message
  2. Retry the SSO login flow
  3. Check that the SSO redirect URL and local callback port are configured correctly
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at lib/client/sso/redirector.go:307 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02). Data as JSON: /api/errors/831c46a1526433e5. Report an issue: GitHub.