BASIC web authentication in domain configuration for JBoss EAP7
asif8782 Mar 20, 2017 2:06 PMHi,
I am trying to configure BASIC authentication for access to an application deployed in JBoss EAP7 in domain mode. I have made the following configurations:
1. Added the following lines in <application EAR file>.ear/<application WAR file>.war/WEB-INF/web.xml file:
<security-constraint>
<auth-constraint>
<role-name>myrole</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Login</realm-name>
</login-config>
<security-role>
<role-name>myrole</role-name>
</security-role>
2. Created <application EAR file>.ear/<application WAR file>.war/WEB-INF/jboss-web.xml file with the following contents:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-web>
<security-domain>myrole</security-domain>
</jboss-web>
3. Added the following lines in <JBoss installation directory>/domain/configuration/domain.xml file:
<security-domain name="myrole" cache-type="default">
<authentication>
<login-module code="UserRoles" flag="required">
<module-option name="rolesProperties" value="${jboss.domain.config.dir}/myrole-roles.properties"/>
<module-option name="usersProperties" value="${jboss.domain.config.dir}/myrole-users.properties"/>
</login-module>
</authentication>
</security-domain>
4. Created the <Jboss domain config dir>/myrole-roles.properties file with the following contents:
myuser=myrole
5. Created the <Jboss domain config dir>/myrole-user.properties file with the following contents:
myuser=mypassword
With all the above configurations in place, when I am trying to access the application, I still don't get the pop up asking me for username/password. Can someone please suggest what is wrong/missing in my configurations.
Thanks,
Asif