{"record":{"id":"864638594dc9f9d3","repo":"netbirdio/netbird","slug":"failed-to-check-sso-support-v","errorCode":null,"errorMessage":"failed to check SSO support: %v","messagePattern":"failed to check SSO support: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/android/login.go","lineNumber":100,"sourceCode":"\t\tsso, err := a.saveConfigIfSSOSupported()\n\t\tif err != nil {\n\t\t\tlistener.OnError(err)\n\t\t} else {\n\t\t\tlistener.OnSuccess(sso)\n\t\t}\n\t}()\n}\n\nfunc (a *Auth) saveConfigIfSSOSupported() (bool, error) {\n\tauthClient, err := auth.NewAuth(a.ctx, a.config.PrivateKey, a.config.ManagementURL, a.config)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to create auth client: %v\", err)\n\t}\n\tdefer authClient.Close()\n\n\tsupportsSSO, err := authClient.IsSSOSupported(a.ctx)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to check SSO support: %v\", err)\n\t}\n\n\tif !supportsSSO {\n\t\treturn false, nil\n\t}\n\n\terr = profilemanager.WriteOutConfig(a.cfgPath, a.config)\n\treturn true, err\n}\n\n// LoginWithSetupKeyAndSaveConfig test the connectivity with the management server with the setup key.\nfunc (a *Auth) LoginWithSetupKeyAndSaveConfig(resultListener ErrListener, setupKey string, deviceName string) {\n\tgo func() {\n\t\terr := a.loginWithSetupKeyAndSaveConfig(setupKey, deviceName)\n\t\tif err != nil {\n\t\t\tresultListener.OnError(err)\n\t\t} else {\n\t\t\tresultListener.OnSuccess()","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/android/login.go#L82-L118","documentation":"After the auth client is created, Android's saveConfigIfSSOSupported calls authClient.IsSSOSupported(ctx), an RPC to management that determines whether the account needs interactive SSO or can use setup-key-style flows. Any RPC failure (transport drop, server error, canceled context) is wrapped as this error with %v.","triggerScenarios":"Management reachable at dial time but failing the RPC mid-flight; management restarting or returning an internal error; the app process backgrounding and canceling the context on Android.","commonSituations":"Flaky mobile connectivity during login; management server upgrade in progress; timeouts on high-latency links.","solutions":["Retry the login attempt; this check is a plain RPC and transient failures are common.","Confirm management is healthy (check its logs or /api/v1/ health) if it fails repeatedly.","Ensure the app keeps the process in the foreground during the login flow so the context is not canceled."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"func isSSOCheckFailure(err error) bool {\n    return err != nil && strings.HasPrefix(err.Error(), \"failed to check SSO support:\")\n}","tryCatchPattern":"sso, err := a.saveConfigIfSSOSupported()\nif err != nil && isSSOCheckFailure(err) {\n    // transient RPC failure is common on mobile: retry with backoff a few\n    // times before reporting to the listener\n}","preventionTips":["Retry the SSO-support check on transient network failures before surfacing an error.","Keep the app in the foreground during login so Android does not cancel the context.","Verify management health if the check fails deterministically."],"tags":["android","auth","sso","grpc","network"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}