Skip to content

security: spring-security-oauth2 is not an optional dependency but should be #359

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

Closed
kaibra opened this issue Jan 21, 2020 · 0 comments · Fixed by #360
Closed

security: spring-security-oauth2 is not an optional dependency but should be #359

kaibra opened this issue Jan 21, 2020 · 0 comments · Fixed by #360
Labels
enhancement New feature or request

Comments

@kaibra
Copy link
Contributor

kaibra commented Jan 21, 2020

v1.2.27 introduced an optional dependency to org.springframework.security.oauth:spring-security-oauth2 in the security starter.
But the implementation is not optional. It causes ClassNotFoundExceptions when the dependency is not provided:

Caused by: java.lang.ClassNotFoundException: org.springframework.security.oauth2.provider.endpoint.FrameworkEndpointHandlerMapping
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
... 62 common frames omitted

Cause is https://github.com/springdoc/springdoc-openapi/blob/master/springdoc-openapi-security/src/main/java/org/springdoc/core/SpringDocSecurityConfiguration.java#L29

@ConditionalOnBean(FrameworkEndpointHandlerMapping.class) does not work like this if the Bean itself is injected within the same signature.

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

Successfully merging a pull request may close this issue.

2 participants