{"record":{"id":"bf29364c8dd53239","repo":"goharbor/harbor","slug":"auth-mode-s-is-not-oidc-based","errorCode":null,"errorMessage":"auth mode: %s is not OIDC based","messagePattern":"auth mode: (.+?) is not OIDC based","errorType":"http","errorClass":null,"httpStatus":412,"severity":"error","filePath":"src/core/controllers/oidc.go","lineNumber":62,"sourceCode":"const userInfoKey = \"oidc_user_info\"\nconst redirectURLKey = \"oidc_redirect_url\"\nconst oidcUserComment = \"Onboarded via OIDC provider\"\n\nconst loginUserOperation = \"login_user\"\n\n// OIDCController handles requests for OIDC login, callback and user onboard\ntype OIDCController struct {\n\tapi.BaseController\n}\n\ntype onboardReq struct {\n\tUsername string `json:\"username\"`\n}\n\n// Prepare include public code path for call request handler of OIDCController\nfunc (oc *OIDCController) Prepare() {\n\tif mode, _ := config.AuthMode(oc.Context()); mode != common.OIDCAuth {\n\t\toc.SendPreconditionFailedError(fmt.Errorf(\"auth mode: %s is not OIDC based\", mode))\n\t\treturn\n\t}\n}\n\n// RedirectLogin redirect user's browser to OIDC provider's login page\nfunc (oc *OIDCController) RedirectLogin() {\n\tstate := utils.GenerateRandomString()\n\tpkceCode, err := pkce.Generate()\n\tif err != nil {\n\t\tlog.Errorf(\"failed to generate PKCE code, error: %v\", err)\n\t\toc.SendInternalServerError(err)\n\t\treturn\n\t}\n\turl, err := oidc.AuthCodeURL(oc.Context(), state, pkceCode)\n\tif err != nil {\n\t\toc.SendInternalServerError(err)\n\t\treturn\n\t}","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/core/controllers/oidc.go#L44-L80","documentation":"Error \"auth mode: %s is not OIDC based\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/core/controllers/oidc.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}