Skip to content

IllegalStateException: Found WebSecurityConfigurerAdapter as well as SecurityFilterChain. Please select just one. #9295

Closed
@ronadjom

Description

@ronadjom

The class org.springframework.security.config.annotation.web.configurationWebSecurityConfiguration declares a springSecurityFilterChain bean. The method first verifies if there exist both securityFilterChains and webSecurityConfigurers. If both exists it throws an IllegalStateException as in the issue title.
I have this same problem, i can't figure out how to have one without the other.

I'm using the keycloak spring boot starter that declares both the abstract class KeycloakWebSecurityConfigurerAdapter(a WebSecurityConfigurer) and the Annotation @KeycloakConfiguration which implicitly imports @EnableWebSecurity. With this constellation, there is no way i can get around the thrown error.

And when i see this example below, i wonder how this works because both a WebSecurityConfigurer is defined and the annotation @EnableWebSecurity is being used.

Can some one please clarify me?

Metadata

Metadata

Assignees

Labels

for: stackoverflowA question that's better suited to stackoverflow.comin: configAn issue in spring-security-config

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions