It's not a secret anymore!
The moose likes JBoss/WildFly and the fly likes Custom Login Module in JBOSS -- How To Make it Work ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Custom Login Module in JBOSS -- How To Make it Work ?" Watch "Custom Login Module in JBOSS -- How To Make it Work ?" New topic

Custom Login Module in JBOSS -- How To Make it Work ?

Soumya Saha
Ranch Hand

Joined: Apr 14, 2006
Posts: 64
Dear All,

I am at my wits end trying to configure a Custom Login Module(extending UserNamePasswordLOginModule) in JBOSS AS 4.2.2.

I have made an entry in Login-config.xml, jboss-web.xml, web.xml, auth.conf. Placed the Custom Login Module in an jar in the $JBOSS_HOME/server/default/lib directory. Added the entry in JBOSS_CLASSPATH.(I also feel this might be the problem, as the class is not getting loaded at startup)

Whenever I try to invoke it , I have no luck at all and I get this error and not sure how to debug it.

[CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.ArrayIndexOutOfBoundsException: 20
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.ajp.AjpProcessor.process(
at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(

Is the location of the class wrong ?

Any Help will be highly appreciated.

[ August 22, 2008: Message edited by: Soumya Saha ]
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Placing the jar file containing the classes that implement the custom login module in the server/xxx/lib directory should be sufficient - you do not need to add it to JBOSS_CLASSPATH. In fact, you should remove the jar from JBOSS_CLASSPATH.

Please post the entry that you made in the login-config.xml file, and the security information in the web.xml and jboss-web.xml files.

Finally, one way to double-check this is to change your custom login module to use the plain UserNamePasswordLoginModule class and see if that works. If it does, your configuration is correct but your classes are at fault. If it does not work, then your configuration is at fault.

JBoss In Action
I agree. Here's the link:
subject: Custom Login Module in JBOSS -- How To Make it Work ?
jQuery in Action, 3rd edition