JBoss EAP 6.2 |如何将数据源用户名密码配置为动态 [英] JBoss EAP 6.2 | How to configure datasource username password to be dynamic

查看:64
本文介绍了JBoss EAP 6.2 |如何将数据源用户名密码配置为动态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求:

我们有JBoss EAP 6.2. 在standalone.xml中,我们配置了数据源. 我们的要求是我们不想在standalone.xml中使用用户名和密码.

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.

那么,是否有任何自定义方式可以从我们的外部系统向JBoss提供用户名和密码?

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

推荐答案

您可以使用服务器启动参数(例如,

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>

可以在standalone.conf中设置

值(例如-Ddatasource.username=$SOME_VAR),该值可以来自外部调用的bash脚本中设置的环境变量

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

或者您可以使用CLI手动添加数据源,请使用以下CLI命令获取命令列表:

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  

但是请注意,这不会绕过standalone.xml,因为用户名/密码仍会添加到xml文件中

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

这篇关于JBoss EAP 6.2 |如何将数据源用户名密码配置为动态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆