Closed freedombird9 closed 6 years ago
Remove @RefreshScope
from Config
since @ConfigurationProperties
classes are already refreshed. Where do you create Config
? Where do you have @EnableConfigurationProperties
?
To reconfigure security (if it can be reconfigured) you would have to listen for an EnvironmentChangeEvent
@spencergibb Config
is autowired into SecurityConfig
bean. And I didn't use @EnableConfigurationProperties
anywhere.
@spencergibb You mean there is no clean way to reconfigure security?
@EnableConfigurationProperties
is required for @ConfigurationProperties
to work. I have no idea if security can by dynamically reconfigured. Ping @rwinch.
@spencergibb Good to know. But the above code did work for me. I've tested it many many times. I think @EnableConfigurationProperties is the default setting now.
Closing due to age of the question. If you would like us to look at this issue, please comment and we will look at re-opening the issue.
I have a web security config class that looks like:
The
Config
is:So basically, whenever I change the
ignored
property, theConfig
bean will be refreshed. It won't happen, however, to theSecurityConfig
bean. Since @RefreshScope doesn't work with @Configuration, I wonder how to refresh the config bean? Specially, I want to have the methodre-run to reflect the changes. Right now, it cannot pick up any change I made to the property file.