I have a password to some service. I need to save it in WildFly 19 and then get it in a java application.
I found a certain amount of information, but I'm not sure if it's outdated.
- Do I need vault?
- How do I write my password to the Wildfly? I found the following commands. Is this enough to save the password?
/subsystem=elytron/credential-store=test:add(relative-to=jboss.server.data.dir, location=test.jceks, create=true,credential-reference={clear-text=storepass})
/subsystem=elytron/credential-store=test:add-alias(alias=keystorepw,secret-value=secret)
- How do I get a password in a java application?
CodePudding user response:
- No, vaults are a legacy tool and you should use a credential store to secure passwords.
- Yes, those commands should be sufficient. You can find more information in the Elytron documentation. The docs for the current Wildfly 26.1 may also be helpful.
- You can find an example application here.