0 Replies Latest reply on Sep 19, 2002 6:01 PM by David Nash

    Custom LoginModule causes exception in JBossSecurityMgrRealm

    David Nash Newbie

      Hi,

      I have written a simple custom LoginModule (very similar to org.jboss.security.auth.spi.Userrolesloginmodule).

      When I access a web page where authentication is required, several calls are made to this module (debug follows):

      [EmbeddedTomcatSX] login called
      [EmbeddedTomcatSX] getUsernameAndPassword called
      [EmbeddedTomcatSX] calling getName
      [EmbeddedTomcatSX] username is null!
      [EmbeddedTomcatSX] password is null!
      [EmbeddedTomcatSX] unauthenticated identity
      [EmbeddedTomcatSX] getIdentity called
      [EmbeddedTomcatSX] Identity: nobody
      [EmbeddedTomcatSX] getRoleSets called
      [EmbeddedTomcatSX] getUsername called
      [EmbeddedTomcatSX] getIdentity called
      [EmbeddedTomcatSX] Identity: nobody
      [EmbeddedTomcatSX] User: null is authenticated

      At this point however, *instead* of causing the browser to prompt the user for userid and password, I get the following exception:

      Error: 500

      Location: /pdmsauth/admin/pdmsauthadmin.jsp

      Internal Servlet Error:

      java.lang.NullPointerException
      at org.jboss.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:113)
      at org.apache.tomcat.core.ContextManager.doAuthenticate(ContextManager.java:837) at org.apache.tomcat.core.RequestImpl.getRemoteUser(RequestImpl.java:341) at org.jboss.tomcat.security.JBossSecurityMgrRealm.authorize(JBossSecurityMgrRealm.java:148) at org.apache.tomcat.core.ContextManager.doAuthorize(ContextManager.java:855) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:789) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      at java.lang.Thread.run(Unknown Source)


      Can anyone suggest what might be causing this behavior??

      TIA,

      David