Example which you suggested implemets DatabaseServerLoginModule. Let me tell my case in details
following is my jaas.login.config file
authenticator = "com.login.test.authenticators.PasswordAuthImpl
digestAlgo = "SHA1"
datasource = ""
now PasswordAuthImpl contains method authenticate(Map, username,pwd) to authenticate user.
Now my question is where do i put my jaas.login.config file in jboss so that it works as it is. and for db what changes i need to make?
Add the following to the login-config.xml file present in %JBOSS_HOME%/server/default/conf directory:
<application-policy name="com.login.test.PasswordLoginModule"> <authentication> <login-module code="com.login.test.authenticators.PasswordAuthImpl" flag="required"> <module-option name="digestAlgo">SHA1</module-option> </login-module> </authentication> </application-policy>
As far creating the login module *configuration* in your own file(jaas.login.config) is concerned, i havent tried it myself, but here's an extract that i found from http://members.capmac.org/~orb/blog.cgi/tech/java/jaas_jboss.html
The documentation suggest that you can place an applications specific login-config.xml in your ear file, but I wasn't able to make it work. However, even though you provide the LoginModule definition in the global login-config.xml, you can still provide the implementation classes in your ear/war file. (you don't have to deploy the LoginModule separately)