-
1. Re: Custom login module issue in JBoss AS 7
marcos_aps Jul 26, 2011 7:05 AM (in response to marcos_aps)I'm sorry. The full class names are:
org.jboss.security.auth.spi.UsernamePasswordLoginModule
org.jboss.security.SimpleGroupSo, 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.
Marcos
-
2. Re: Custom login module issue in JBoss AS 7
dlofthouse Jul 26, 2011 7:22 AM (in response to marcos_aps)The jar you are looking for is: -
{jboss.home}/modules/org/picketbox/main/picketbox-4.0.0.Final.jar
-
3. Re: Custom login module issue in JBoss AS 7
marcos_aps Jul 26, 2011 8:23 AM (in response to dlofthouse)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:
<subsystem xmlns="urn:jboss:domain:security:1.0">
<security-domains>
<security-domain name="scdh" cache-type="default">
<authentication>
<login-module code="br.urca.scdh.ejb.seguranca.ModuloLogin" flag="required"/>
</authentication>
</security-domain>
</security-domains>
</subsystem>
and in jboss-web.xml in my web application:
<jboss-web>
<security-domain>java:/jaas/scdh</security-domain>
</jboss-web>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?
Marcos
-
4. Re: Custom login module issue in JBoss AS 7
jaikiran Jul 26, 2011 10:33 AM (in response to marcos_aps)Don't use the jndi name in the security-domain element. Use just the name:
<security-domain>scdh</security-domain>
If that still doesn't work, then enable TRACE level logging of security and see what it shows.
-
5. Re: Custom login module issue in JBoss AS 7
marcos_aps Jul 26, 2011 10:46 AM (in response to jaikiran)jaikiran pai wrote:
Don't use the jndi name in the security-domain element. Use just the name:
<security-domain>scdh</security-domain>
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.
Marcos
-
6. Re: Custom login module issue in JBoss AS 7
jaikiran Jul 26, 2011 11:00 AM (in response to marcos_aps)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>
-
7. Re: Custom login module issue in JBoss AS 7
marcos_aps Jul 26, 2011 11:48 AM (in response to jaikiran)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.
Marcos
-
8. Re: Custom login module issue in JBoss AS 7
rory8000 Feb 14, 2012 3:27 PM (in response to marcos_aps)Marcos,
Did you find the solution to your problem???