In JBoss AS 6 a have a custom login module that extends org.jboss.security.auth.spi.UsernamePasswordLoginModule and also in my custom login module I use the class org.jboss.security.SimpleGroup. I was trying to port my old application to JBoss 7 but these classes seem not to exist anymore. So in which package and jar(s) are these classes in JBoss AS 7?
Thank you in advance.
I'm sorry. The full class names are:
So, what has changed in JBoss AS 7 regarding login modules? What class should I extend to create my own login module? I looked for this information and didn't find it anywhere. I think that getting this information is useful not only for me, but for the whole community, as login modules are a very popular feature.
Thank you for the answer, Darran!
So, I created a class that extends org.jboss.security.auth.spi.UsernamePasswordLoginModule, and configured it in standalone.xml:
<security-domain name="scdh" cache-type="default">
<login-module code="br.urca.scdh.ejb.seguranca.ModuloLogin" flag="required"/>
and in jboss-web.xml in my web application:
but it seems that my login module is not called when I perform the login in my application. The login always fail and none of the debug console messages that I placed in the login module get displayed. Any ideas?
jaikiran pai wrote:
Don't use the jndi name in the security-domain element. Use just the name:
If that still doesn't work, then enable TRACE level logging of security and see what it shows.
Well, it still hasn't worked. The custom login module is still not called. I'm sorry for the dumb question but could you please show how do I enable the TRACE level logging of security so that I can see what's happening? Seeing what could possibly be happening would help a lot, as there's no error messages showing until now.
Add/change the following to your standalone.xml in the logging subsystem:
<periodic-rotating-file-handler name="FILE"> <level name="TRACE"/> ... </periodic-rotating-file-handler> <logger category="org.jboss.security"> <level name="TRACE"/> </logger> <logger category="org.jboss.as.web.security"> <level name="TRACE"/> </logger> <logger category="org.apache.catalina"> <level name="TRACE"/> </logger>
With trace enabled I saw the error message. JBoss was saying it couldn't find the login module... in the war file. war file? But my custom login module was in an ejb module, why JBoss was looking for it in the war module? So I placed the login module in the war module, changed the code attribute in login-module to point to the new location and everyting went fine. I think that JBoss was looking for the login module in the war file because my ejb module, for the time being, doesn't has any session bean. It just had the login module, that is a regular jave file. Maybe when I add some session beans to the ejb module, JBoss will be able to find the login module there as well. I'm just thinking the the ejb module didn't get deployed. But maybe I'm wrong.
Thank you all.