SecuredAnnotationSecurityMetadataSource cannot infer annotation class when annotationMetadataExtractor is provided as a lamda expression #10592
Labels
for: external-project
For an external project and not something we can fix
Summary
In the following example the constructor of the SecuredAnnotationSecurityMetadataSource cannot understand the type of the annotation and instead of assigning the value "MyCustomAnnotation" in the annotationType field it assigns the value "Annotation"
which later does not allow the org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor to be triggered for any method that is annotated with the "MyCustomAnnotation" annotation.
When rewriting the annotationMetaDataExtractor method without lambdas, the annotationType field of the SecuredAnnotationSecurityMetadataSource is correctly set to "MyCustomAnnotation" and the interceptor is triggered as expected
Actual Behavior
org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor not to be triggered for any method that is annotated with the "MyCustomAnnotation" annotation.
Expected Behavior
Any method annotation with @MyCustomAnnotation should be picked up by the interceptor (and apply the security logic)
Version
spring-security-code: 5.5.3
The text was updated successfully, but these errors were encountered: