[jboss-user] [Security & JAAS/JBoss] - Re: NPE in ExtendedFormAuthenticator

leegreiner do-not-reply at jboss.com
Wed Jul 9 13:34:27 EDT 2008


This was our solution:


  | package edu.duke.dcri.web.tomcat.security;
  | 
  | import java.io.IOException;
  | import org.apache.catalina.connector.Request;
  | import org.apache.catalina.connector.Response;
  | import org.apache.catalina.deploy.LoginConfig;
  | 
  | public class ExtendedFormAuthenticator extends org.jboss.web.tomcat.security.ExtendedFormAuthenticator
  | {
  | 
  |     public ExtendedFormAuthenticator()
  |     {
  |     }
  | 
  |     public boolean authenticate(Request request, Response response, LoginConfig config)
  |         throws IOException
  |     {
  |         boolean alreadyAuthenticated = false;
  |         try
  |         {
  |             alreadyAuthenticated = super.authenticate(request, response, config);
  |         }
  |         catch(NullPointerException npe) { }
  |         return alreadyAuthenticated;
  |     }
  | }
  | 

When the NullPointerException is raised there is no session and the authenticator returns false, the desired effect.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163364#4163364

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163364



More information about the jboss-user mailing list