Skip to content

AuthorizationAnnotationUtils.findUniqueAnnotation broken for synthetic methods #13132

Closed
@f-cramer

Description

@f-cramer

Describe the bug
When annotating a method that causes a synthetic method to be created (for example when overriding Spring Datas ListCrudRepository#findAllById which in turn overrides CrudRepository#findAllById) both the original and the synthetic method will contain this annotation when checking at runtime. This leads to a AnnotationConfigurationException being thrown when trying to call the overridden method although the annotation is only present once in the source code

To Reproduce
Check out https://github.com/f-cramer/spring-security-synthetic-methods an call http://localhost:8080/books with username admin and password abc123.

Expected behavior
Synthetic methods should be ignored when validating the uniqueness of security annotations

Metadata

Metadata

Assignees

Labels

in: coreAn issue in spring-security-coretype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions