jBoss add-user.bat没有看到新的领域

时间:2015-11-09 15:20:04

标签: jboss

我在standalone.xml创建了一个新领域,现在我正在尝试在该领域创建一个新用户。当我使用像

这样的完整命令时
add-user -a -r realm-name -u user -p password

我收到错误:

JBAS015281: The user supplied realm name 'realm-name' does not match the realm name discovered from the property file(s) 'ApplicationRealm'.

当我只运行add-user时,它会提示选择领域,并且列表中只有applicationrealm和managementrealm。

以下是我standalone.xml的摘要:

1)域名

<security-domain name="realm-domain" cache-type="default">
    <authentication>
         <login-module code="Remoting" flag="optional">
             <module-option name="password-stacking" value="useFirstPass"/>
         </login-module>
         <login-module code="RealmUsersRoles" flag="required">
             <module-option name="usersProperties" value="${jboss.server.config.dir}/rt-users.properties"/>
             <module-option name="rolesProperties" value="${jboss.server.config.dir}/rt-roles.properties"/>
             <module-option name="realm" value="realm-name"/>
             <module-option name="password-stacking" value="useFirstPass"/>
        </login-module>
    </authentication>
</security-domain>

2)境界

<security-realm name="realm-name">
   <authentication>
     <local default-user="$local"/>
     <jaas name="realm-domain"/>
   </authentication>
</security-realm>

2 个答案:

答案 0 :(得分:3)

我在这里发布了我发现的解决方案,也许对遇到此问题的其他人有用!

我在Jboss Eap 7上使用add-user.sh,试图将用户添加到我创建的新安全领域我遇到了同样的问题:

jboss-eap-7.0/bin/add-user.sh -r HttpsRealm

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): 

似乎我的新领域无法识别,但如果我还指定了我创建的与该领域相关的新属性文件,它按预期工作!

jboss-eap-7.0/bin/add-user.sh  -r HttpsRealm -up stand-env/stand1/standalone/configuration/https-mgmt-users.properties 

Enter the details of the new user to add.
Using realm 'HttpsRealm' as discovered from the existing property files.
Username :

希望它有所帮助!

答案 1 :(得分:0)

add-user实用程序不管理新的属性文件,您必须单独管理。

看:https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/Add_a_New_Security_Realm.html

  

将用户和角色添加到此新领域时,信息将存储在与默认安全领域不同的文件中。您可以使用自己的应用程序或程序管理此新文件。