Reputation: 12222
Is there a way to secure web application with the same user and roles configuration that ManagementRealm?
I know that there is a security-domain "java:/jaas/other" that delegates to ApplicationRealm. How to create similar security-domain that delegates to ManagementRealm?
Other words - I want a web application to be accessible by same users that can access JBoss' Admin Console.
I'm running domain mode.
//Edit:
I was able to set-up security domain that refers to management realm by using login-module RealmDirect and setting realm=ManagementRealm Authentication works fine, however it does not pick user roles. Exact same configuration for ApplicationRealm works fine.
Upvotes: 0
Views: 1803
Reputation: 1316
I had the same challenge. After defining a security domain that refers to "ManagementRealm" and defining the role in web.xml, the trick is to configure the ManagementRealm to map groups to roles:
authorization map-groups-to-roles="true"
<security-realm name="ManagementRealm">
<authentication>
<local default-user="$local" skip-group-loading="true"/>
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization map-groups-to-roles="true">
<properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>
Upvotes: 0