2015-11-09 30 views
0

我在standalone.xml中創建了一個新領域,現在我試圖在該領域創建一個新用戶。當我使用完整的命令一樣jBoss add-user.bat沒有看到新的領域

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,它promts選擇的境界,只有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> 

回答

0

該插件的用戶實用程序不管理新的屬性文件,則必須單獨管理。

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

When you add users and roles to this new realm, the information will be stored in a separate file from the default security realms. You can manage this new file using your own applications or procedures.

+0

對不起,我還不明白。你的鏈接是關於我如何創建領域,但是我沒有通過編輯'standalone.xml'來做到這一點?根據你的說法,如果我實際上不能這樣做,那麼究竟是什麼「添加用戶」呢,爲它添加用戶呢? – SMSk

+0

是的! standalone.xml或domain.xml!添加用戶是一個默認實用程序並管理默認領域。 –

+0

但是,對於您的領域工作,您必須將其分配給可用的管理界面之一。我知道你很想創建你自己的用戶管理庫... –

2

我在這裏發佈我已經找到了解決辦法,也許它可能是別人誰遇到這個問題有用!

我使用add-user.sh JBoss上的eap 7,嘗試將用戶添加到我創建我遇到了同樣的問題,新的安全領域:

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 : 

希望它可以幫助別人!