{"record":{"id":"98fe778fff5b84ca","repo":"siyuan-note/siyuan","slug":"unsupported-oidc-provider","errorCode":null,"errorMessage":"Unsupported OIDC provider","messagePattern":"Unsupported OIDC provider","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/oidc.go","lineNumber":533,"sourceCode":"\tif config.ClientID == \"\" {\n\t\treturn errors.New(\"OIDC client ID is required\")\n\t}\n\tif config.Provider == conf.OIDCProviderGitHub && config.ClientSecret == \"\" {\n\t\treturn errors.New(\"GitHub OAuth client secret is required\")\n\t}\n\tif (config.Provider == conf.OIDCProviderCustom || config.Provider == conf.OIDCProviderMicrosoft) && config.IssuerURL == \"\" {\n\t\treturn errors.New(\"OIDC issuer URL is required\")\n\t}\n\tif (config.Provider == conf.OIDCProviderCustom || config.Provider == conf.OIDCProviderMicrosoft) && config.IssuerURL != \"\" {\n\t\tissuer, err := url.Parse(config.IssuerURL)\n\t\tif err != nil || issuer.Host == \"\" || issuer.User != nil || issuer.RawQuery != \"\" || issuer.Fragment != \"\" ||\n\t\t\t(issuer.Scheme != \"https\" && !util.IsLocalHostname(issuer.Hostname())) {\n\t\t\treturn errors.New(\"OIDC issuer URL must use HTTPS unless it is a loopback address\")\n\t\t}\n\t}\n\tif config.Provider != conf.OIDCProviderCustom && config.Provider != conf.OIDCProviderGoogle &&\n\t\tconfig.Provider != conf.OIDCProviderMicrosoft && config.Provider != conf.OIDCProviderGitHub {\n\t\treturn errors.New(\"Unsupported OIDC provider\")\n\t}\n\tif !config.AllowAll && len(config.ClaimRules) == 0 {\n\t\treturn errors.New(\"OIDC login requires at least one claim rule when Allow all users is disabled\")\n\t}\n\tfor _, rule := range config.ClaimRules {\n\t\tif rule == nil || rule.Claim == \"\" || len(rule.Values) == 0 {\n\t\t\treturn errors.New(\"OIDC claim rules must include a claim and at least one value\")\n\t\t}\n\t\tif rule.Operator != conf.OIDCClaimOperatorEquals && rule.Operator != conf.OIDCClaimOperatorContains {\n\t\t\treturn errors.New(\"Unsupported OIDC claim rule operator\")\n\t\t}\n\t\tfor _, value := range rule.Values {\n\t\t\tif value == \"\" {\n\t\t\t\treturn errors.New(\"OIDC claim rule values cannot be empty\")\n\t\t\t}\n\t\t}\n\t}\n\treturn nil","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/oidc.go#L515-L551","documentation":"Sixth check in ValidateOIDCConfiguration (kernel/model/oidc.go:533): the Provider field is not one of Custom, Google, Microsoft, or GitHub. This guards against typos and unknown enum values saved into the config (e.g. an integer that does not map to a supported provider).","triggerScenarios":"Saving an OIDC config whose Provider was set to an out-of-range constant, a string, or an integer outside the four supported values; typically from hand-edited JSON or a future-version downgrade.","commonSituations":"Editing conf.json directly with a wrong provider code; restoring a config from a different SiYuan version; a bug in a plugin that writes the OIDC block.","solutions":["Pick one of GitHub, Google, Microsoft, or Custom from the settings UI and re-save.","If editing JSON, use the exact conf.OIDCProvider* constant value.","After fixing, re-run ValidateOIDCConfiguration to confirm all downstream checks pass."],"exampleFix":"// before\ncfg.Provider = 99 // unknown\n// after\ncfg.Provider = conf.OIDCProviderGitHub // one of the four supported constants","handlingStrategy":"validation","validationCode":"switch cfg.Provider {\ncase conf.OIDCProviderCustom, conf.OIDCProviderGoogle,\n     conf.OIDCProviderMicrosoft, conf.OIDCProviderGitHub:\n    // ok\ndefault:\n    return errors.New(\"unsupported OIDC provider\")\n}","typeGuard":"func supportedProvider(p conf.OIDCProvider) bool {\n    switch p {\n    case conf.OIDCProviderCustom, conf.OIDCProviderGoogle,\n         conf.OIDCProviderMicrosoft, conf.OIDCProviderGitHub:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Do not hand-edit the OIDC provider code in conf.json.","After major version upgrades, re-validate OIDC config in the UI."],"tags":["oidc","provider","config","validation"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}