I am using spring boot with an access to keycloak. I need to leave the keycloak configuration in the keycloak.json file I would like to get teh values from the json using the PropertySource annotation...
My application.yml
keycloak:
configurationFile: "classpath:keycloak.json"
My keycloak.json
{
"realm": "MyRealm",
"auth-server-url": "https://keycloakURL",
....
}
My class
@Controller
@Configuration
@PropertySource("classpath:keycloak.json")
public class MyClass{
@Autowired
private Environment env;
@RequestMapping(value = "/mycontroller", method = RequestMethod.GET)
public String method(Model model) {
env.getProperty("auth-server-url")
}
The problem is that i am getting null for this environment variable