Maly Velky [
https://community.jboss.org/people/malyvelky] commented on the document
"JBoss AS7 : Security Domain Model"
To view all comments on this document, visit:
https://community.jboss.org/docs/DOC-16811#comment-10096
--------------------------------------------------
h3. Using custom login module with code inside WAR
The description above wasn't really clear to me so this is how I got it working:
1. Download
https://community.jboss.org/servlet/JiveServlet/download/17357-5-45174/cu...
custom_module.zipand
https://community.jboss.org/servlet/JiveServlet/download/17357-5-45175/fo...
form-auth.war from
https://community.jboss.org/docs/DOC-17357
JBossAS7SecurityCustomLoginModules article
2. Do one of the following: EITHER: Repackage custom_module.zip/main/custom_module.jar
into form-auth.war/WEB-INF/lib/custom_module.jar OR: Extract
custom_module.zip/main/custom_module.jar/custom/MyLoginModule.class and repackage it into
form-auth.war/WEB-INF/classes/custom/MyLoginModule.class
3. Modify <JBoss AS 7.1.0.Final>/standalone/configuration/standalone.xml by adding
the security domain shown below
4. Start JBoss standalone and deploy the WAR; you should be now able to log-in with user
anil, psw anil
standalone.xml security domain snippet:
----
...
<security-domains>
<security-domain name="form-auth"
cache-type="default">
<authentication>
<login-module code="custom.MyLoginModule"
flag="required">
<module-option name="usersProperties"
value="users.properties"/>
<module-option name="rolesProperties"
value="roles.properties"/>
</login-module>
</authentication>
</security-domain>
...
----
--------------------------------------------------