I am using spring mongo template for Mongo db server, i need to encrypt the password in the property file and decrypt in the Mongo template
I am using UserCredentials class to pass user name & password.
Can any one help how to overwrite this class to decrypt the encrypted password and pass into Mongo template
<bean id="simpleJdbcTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongo" ref="mongo"/>
<constructor-arg name="databaseName" value="mooadmin"/>
<constructor-arg name="userCredentials" ref="mongoCredentials"/>
</bean>
<!-- Factory bean that creates the Mongo instance -->
<bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean">
<property name="host" value="${mongo.server}"/>
<property name="port" value="${mongo.port}"/>
</bean>
<bean id="mongoCredentials"
class="org.springframework.data.authentication.UserCredentials">
<constructor-arg name="username" value="${mongo.username}" />
<constructor-arg name="password" value="${mongo.password}" />
</bean>