{"record":{"id":"2dd8bef2a785909e","repo":"spring-projects/spring-security","slug":"oidc-provider-not-configured","errorCode":"oidc_provider_not_configured","errorMessage":"An OpenID Connect Authentication Provider has not been configured. Check to ensure you include the dependency 'spring-security-oauth2-jose'.","messagePattern":"An OpenID Connect Authentication Provider has not been configured\\. Check to ensure you include the dependency 'spring-security-oauth2-jose'\\.","errorType":"error_code","errorClass":"OAuth2AuthenticationException","httpStatus":null,"severity":"error","filePath":"config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer.java","lineNumber":814,"sourceCode":"\t}\n\n\tprivate static class OidcAuthenticationRequestChecker implements AuthenticationProvider {\n\n\t\t@Override\n\t\tpublic Authentication authenticate(Authentication authentication) throws AuthenticationException {\n\t\t\tOAuth2LoginAuthenticationToken authorizationCodeAuthentication = (OAuth2LoginAuthenticationToken) authentication;\n\t\t\tOAuth2AuthorizationRequest authorizationRequest = authorizationCodeAuthentication.getAuthorizationExchange()\n\t\t\t\t.getAuthorizationRequest();\n\t\t\tif (authorizationRequest.getScopes().contains(OidcScopes.OPENID)) {\n\t\t\t\t// Section 3.1.2.1 Authentication Request -\n\t\t\t\t// https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest scope\n\t\t\t\t// REQUIRED. OpenID Connect requests MUST contain the \"openid\" scope\n\t\t\t\t// value.\n\t\t\t\tOAuth2Error oauth2Error = new OAuth2Error(\"oidc_provider_not_configured\",\n\t\t\t\t\t\t\"An OpenID Connect Authentication Provider has not been configured. \"\n\t\t\t\t\t\t\t\t+ \"Check to ensure you include the dependency 'spring-security-oauth2-jose'.\",\n\t\t\t\t\t\tnull);\n\t\t\t\tthrow new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString());\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean supports(Class<?> authentication) {\n\t\t\treturn OAuth2LoginAuthenticationToken.class.isAssignableFrom(authentication);\n\t\t}\n\n\t}\n\n\tprivate static final class OidcClientSessionEventListener implements ApplicationListener<AbstractSessionEvent> {\n\n\t\tprivate final Log logger = LogFactory.getLog(OidcClientSessionEventListener.class);\n\n\t\tprivate OidcSessionRegistry sessionRegistry = new InMemoryOidcSessionRegistry();\n\n\t\t/**","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/spring-projects/spring-security/blob/96852e8860138a482cb13d1479573f24ff6443c6/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer.java#L796-L832","documentation":"During an OpenID Connect login flow, OidcAuthenticationRequestChecker authenticates the OAuth2LoginAuthenticationToken and, when the authorization request contains the 'openid' scope, requires an OidcAuthorizationCodeAuthenticationProvider to complete OIDC authentication. This AuthenticationException fires when that OIDC provider is absent from the provider manager — typically because spring-security-oauth2-jose is not on the classpath — so an OIDC login request cannot be processed even though the client registration/redirect was initiated with the openid scope.","triggerScenarios":"Thrown at config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer.java:814 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the 'spring-security-oauth2-jose' dependency so the OidcAuthorizationCodeAuthenticationProvider is auto-configured","Remove the 'openid' scope from the client registration if OIDC login is not intended","Verify oauth2Login() is configured and the provider is registered on the AuthenticationManager"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"96852e8860138a482cb13d1479573f24ff6443c6","analyzedAt":"2026-09-10T23:25:23.477Z","contentChangedAt":"2026-09-10T23:25:23.477Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}