-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
WARN Bean 'grantedAuthorityDefaults' of type [org.springframework.security.config.core.GrantedAuthorityDefaults] is not eligible for getting processed by all BeanPostProcessors #14751
Comments
Hi, @paschm. Can you verify if making your bean method |
Hello @marcusdacoregio, thanks for your advice.
still leads to
leads to
The combination of both ( static + role hint ) does work and the bean seems to be initialized
Maybe the addition of the role hint should be added to the documentation? https://docs.spring.io/spring-security/reference/servlet/authorization/architecture.html#authz-authorities |
Thanks for checking @paschm. The reason that happens is because the Are you interested in submitting a PR that updates the documentation? |
Hello @marcusdacoregio,
I submitted a PR, see above. I didn't extend the xml example, as we don't use xml configuration any more and I don't know how you can do a infrastructure bean declaration in this case. Feel free to extend it yourself, if necessary. |
Closed in favor of https://github.com/spring-projects/spring-security/pull/14779/files |
Describe the bug
If a custom
GrantedAuthorityDefaults
is initialized to override the default role prefix this leads to following warnings logged by theBeanPostProcessorChecker
inspring-context
:where
securityConfig
initializesgrantedAuthorityDefaults
As prerequisites method security must be enabled with jsr250 annotation support ( see above ) and additional BeanPostProcessors must be registered, i. e. by adding
spring-actuator
to the classpath.Side note: As of Spring 6.1.0 messages are logged with level
WARN
instead ofINFO
, if beans are ineligible for complete post-processing. See spring-projects/spring-framework#24092 for more details. This is why we noticed this behaviour. There doesn't seem to be any practical impacts at least not in our applications with the BeanPostProcessors we are using.To Reproduce
The behaviour is reproducable with spring-boot 3.2.3, which uses spring framework 6.1.4 and spring-security 6.2.2 under the hood. Just run the Application in this example project demo.zip.
Expected behavior
No warnings regarding ineligible beans for complete post-processing should be logged.
Sample
demo.zip
The text was updated successfully, but these errors were encountered: