I want to optionally enable a @Configuration
, based on whether a type of application.properties
property exists or not. However I will not know the whole property name in advance, only part of its prefix i.e.
spring.security.oauth2.<provider-name>.url=x.y.z
And the goal is to enable the configuration using something like:
@ConditionalOnProperty(prefix = "spring.security", value="oauth2.*")
or something like that but it doesn't seem to work. I've tried multiple combinations, none work it always expects the full property name but I don't know the <provider-name>
in advance. Any ways to achieve this functionality?