- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-23-2019 11:59 AM
Hi,
We have java applications that uses Hybernate technology. Hybernate has .xml config files which has DB connection information, can we implement AIM CP to eliminate hard-coded credentials ?
if so, how can we coded existing xml file to make a call to AIM CP.
thank you
04-23-2019 07:43 PM
@Anurag . There are multiple ways we can do this. I'm thinking of using the below approach
The below link has the working code for replacing values of an xml element <name>.
https://www.rgagnon.com/javadetails/java-0625.html
What you can do, first make sure you are able to replace an element value of a given sample xml file(data.xml). I've tested in my lab and its working fine. a small modification in the below line. (Note: keep input and file name as data.xml)
NodeList nodes = (NodeList)xpath.evaluate("//employee/name[text()]", doc, XPathConstants.NODESET);
Second, please make a java sdk call to your vaulted password : example given in the below link. You can modify and keep it ready in separate java module/function
Third, call your java module inside the nodes.item(idx).setTextContent(call your java module());
Test and validate!!!
04-24-2019 04:08 AM
You might not even need AIM for that. You can add a so-called "Usage" or "Service account platform" to an account in the Vault, and the CPM will update the password in the "Usage" whenever the associated account is changed. Usages can be config files, windows services, IIS app pools... and XML files! More info here: https://cyberarkdocu.azurewebsites.net/Product-Doc/OnlineHelp/PAS/Latest/en/Content/PASIMP/AccountsStoredInConfigurationFiles.htm?Highlight=xml
04-24-2019 02:33 PM
Hi @Anurag . , Yes I agree with @Bernhard Brückler and thats very straightforward.. There is an existing solution article you can refer
https://community.cyberark.com/s/article/00004750
04-24-2019 03:26 PM
@Bernhard Brückler Thank you ! but however my goal to remove hard-coded creds from config files is not solved if i use "usage or service account paltform."
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

