Skip to content

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

Closed
@kaibra

Description

@kaibra

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.

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