Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringDocSecurityConfiguration class not sufficiently constrained #2139

Closed
alexfeigin opened this issue Mar 15, 2023 · 2 comments
Closed

SpringDocSecurityConfiguration class not sufficiently constrained #2139

alexfeigin opened this issue Mar 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@alexfeigin
Copy link

alexfeigin commented Mar 15, 2023

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
@alexfeigin
Copy link
Author

if anybody else is experiencing the same, we are currently mitigating with configuration springdoc.enable-spring-security=false

@bnasslahsen
Copy link
Contributor

@alexfeigin,

Thank you for the information!

@bnasslahsen bnasslahsen added the enhancement New feature or request label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants