{"record":{"id":"831c46a1526433e5","repo":"gravitational/teleport","slug":"err-error","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/client/sso/redirector.go","lineNumber":307,"sourceCode":"\n\treturn nil\n}\n\n// clickableURL returns a short, clickable URL that will redirect\n// the browser to the SSO redirect URL.\nfunc (rd *Redirector) clickableURL(redirectURL, postForm string) string {\n\t// shortPath is a link-shortener path presented to the user\n\t// it is used to open up the browser window, notice\n\t// that redirectURL will be set later\n\tshortPath := \"/\" + uuid.New().String()\n\n\t// short path is a link-shortener style URL\n\t// that will redirect to the Teleport-Proxy supplied address\n\trd.mux.HandleFunc(shortPath, func(w http.ResponseWriter, r *http.Request) {\n\t\tif postForm != \"\" {\n\t\t\tform, err := base64.StdEncoding.DecodeString(postForm)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, err.Error(), trace.ErrorToCode(err))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err := saml.WriteSAMLPostRequestWithHeaders(w, form); err != nil {\n\t\t\t\thttp.Error(w, err.Error(), trace.ErrorToCode(err))\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\thttp.Redirect(w, r, redirectURL, http.StatusFound)\n\t\t\treturn\n\t\t}\n\t})\n\n\treturn clickableURL(rd.baseURL() + shortPath)\n}\n\n// clickableURL fixes the address in a URL to make sure\n// it's clickable, e.g. it replaces \"undefined\" addresses like\n// 0.0.0.0 used in network listeners with the loopback address.","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/lib/client/sso/redirector.go#L289-L325","documentation":"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.","triggerScenarios":"Thrown at lib/client/sso/redirector.go:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the local proxy/tsh logs to identify the underlying error behind the message","Retry the SSO login flow","Check that the SSO redirect URL and local callback port are configured correctly"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}