{"record":{"id":"683b2660e03cdeff","repo":"alibaba/nacos","slug":"built-in-oidc-auth-plugin-is-not-available","errorCode":null,"errorMessage":"Built-in OIDC auth plugin is not available","messagePattern":"Built-in OIDC auth plugin is not available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcPluginAutoConfiguration.java","lineNumber":56,"sourceCode":"@Import(OidcWebSecurityConfig.class)\n@SuppressWarnings(\"PMD\")\npublic class OidcPluginAutoConfiguration {\n    \n    /**\n     * Register OidcLoginController bean.\n     *\n     * @return OidcLoginController\n     */\n    @Bean\n    public OidcLoginController oidcLoginController() {\n        return new OidcLoginController(getOidcAuthPluginService());\n    }\n    \n    static OidcAuthPluginService getOidcAuthPluginService() {\n        AuthPluginService plugin = AuthPluginManager.getInstance().getAllPlugins()\n            .get(OidcProtocolConstants.AUTH_PLUGIN_TYPE);\n        if (!(plugin instanceof OidcAuthPluginService)) {\n            throw new IllegalStateException(\"Built-in OIDC auth plugin is not available\");\n        }\n        return (OidcAuthPluginService) plugin;\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":61,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcPluginAutoConfiguration.java#L38-L61","documentation":"Thrown at Spring bean wiring time by OidcPluginAutoConfiguration.getOidcAuthPluginService() when the AuthPluginManager registry does not contain an OidcAuthPluginService instance under the OIDC auth type. This is a startup/SPI wiring failure: OIDC auth was enabled (ConditionOnOidcAuth matched) but the plugin was never loaded or is the wrong type.","triggerScenarios":"OidcPluginAutoConfiguration is active (OIDC enabled) but AuthPluginManager.getAllPlugins().get(AUTH_PLUGIN_TYPE) returns null or a non-OidcAuthPluginService object. This happens when the SPI service file is missing, the jar is absent, or plugin initialization failed silently.","commonSituations":"The nacos-oidc-auth-plugin jar is not on the classpath; the META-INF/services AuthPluginService SPI file is missing or doesn't list OidcAuthPluginService; an earlier exception during plugin init left it unregistered; a conflicting custom plugin registered under the same type.","solutions":["Ensure plugin-default-impl/nacos-oidc-auth-plugin is packaged and present on the server classpath.","Verify the SPI registration file META-INF/services/com.alibaba.nacos.plugin.auth.spi.server.AuthPluginService exists in the jar and names the OIDC service.","Check startup logs for an earlier exception during AuthPluginManager initialization that prevented registration.","Confirm no conflicting plugin is registering a different type under OidcProtocolConstants.AUTH_PLUGIN_TYPE."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// At startup, verify the OIDC plugin is registered before relying on it\nAuthPluginService plugin = AuthPluginManager.getInstance()\n    .getAllPlugins().get(OidcProtocolConstants.AUTH_PLUGIN_TYPE);\nif (!(plugin instanceof OidcAuthPluginService)) {\n    throw new IllegalStateException(\n        \"OIDC plugin not loaded; check classpath and SPI registration\");\n}","typeGuard":"boolean isOidcPluginLoaded(AuthPluginService p) {\n    return p instanceof OidcAuthPluginService;\n}","tryCatchPattern":"try {\n    OidcPluginAutoConfiguration.getOidcAuthPluginService();\n} catch (IllegalStateException e) {\n    // startup wiring failure — fail fast and report missing jar/SPI\n    log.error(\"OIDC plugin unavailable; ensure nacos-oidc-auth-plugin is on the classpath\");\n    throw e;\n}","preventionTips":["Confirm the nacos-oidc-auth-plugin jar is packaged with the server distribution.","Verify META-INF/services/com.alibaba.nacos.plugin.auth.spi.server.AuthPluginService lists the OIDC service.","Scan startup logs for earlier plugin-init exceptions that prevent registration."],"tags":["oidc","plugin","startup","spi","spring"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}