Skip to content

SpringDocSecurityConfiguration class not sufficiently constrained #2139

Closed
@alexfeigin

Description

@alexfeigin

1.SpringDocSecurityConfiguration class is @ConditionalOnClass(Authentication.class)
which comes with spring-security-core.
2. It should also condition itself on a class from spring-security-web like @ConditionalOnClass(SecurityFilterChain.class)
3. As of springdoc v2.0.4. If a project has a dependency on spring-security-core and not on spring-security-web, the project will fail to startup with a stack trace similar to this:

2023-03-15 13:48:47.904 IST ERROR [restartedMain] [o.s.b.SpringApplication:822] Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springdoc.core.configuration.SpringDocSecurityConfiguration$SpringSecurityLoginEndpointConfiguration': Lookup method resolution failed
....
Caused by: java.lang.NoClassDefFoundError: org/springframework/security/web/FilterChainProxy

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions