I'm working on a springboot application which has security.xml used by AuthFilter[Org level authentication filter]. This xml looks in passwords.properties for username, password, etc. Sharing sample ex below.
security.xml -
<api-username>${api.username}</api-username>
passwords.properties -
api.username=abc
This works fine if the values are hardcoded in passwords.properties. But if I have to pass the values from env vars, property substitution isn't happening.
passwords.properties :
api.username=$${api.username}
env vars :
api.username=abc
I'm stuck here. Could someone let me know a way to achieve this.
I added below in my application.properties to make spring understand that the passwords.properties is a config file.
spring.config.import=classpath:passwords.properties
making this change too didn't help
=================
Update
Looks like this XML is read during servlet initialization. Will property substitution work in this case?
=================