JBoss EAP 6.2 | How to configure datasource username password to be dynamic

不打扰是莪最后的温柔 提交于 2021-02-08 06:41:37

问题


Requirement:

We have JBoss EAP 6.2. In standalone.xml, we have datasource configured. Our requirement is that we do not want username and password in standalone.xml.

Username and password are received from some external system call.

So, is there any custom way to provide username and password to JBoss from this our external system?


回答1:


You can provide dynamic values in standalone.xml using server startup parameters eg.

<security>
    <user-name>${datasource.username}</user-name>
    <password>${datasource.password}</password>
</security>

values can be set in standalone.conf (eg. -Ddatasource.username=$SOME_VAR) which could come from environment variables set in a bash script from your external call

Or you can use the CLI to add a datasource manually, use the following CLI command to get a list of commands:

data-source add --help  

note however this wont bypass standalone.xml as the username/password will still be added to the xml file



来源:https://stackoverflow.com/questions/30747466/jboss-eap-6-2-how-to-configure-datasource-username-password-to-be-dynamic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!