[jboss-user] [JBoss Seam] - Why is Authenticator.authenticate() called twice if it retur

appendix do-not-reply at jboss.com
Mon Oct 22 04:25:42 EDT 2007


Hi!

I've just generated an application with seam-gen (seam-2.0.0.CR2) and modified the Authenticator.authenticate() method to return false as well:


  |     public boolean authenticate()
  |     {
  |         log.info("authenticating #0", identity.getUsername());
  |         if ("Foo".equalsIgnoreCase(identity.getUsername())){
  |             identity.addRole("admin");
  |             log.info("Autentication: #0", "TRUE");
  |             return true;
  |         }else{
  |             log.info("Autentication: #0", "FALSE");
  |         	return false;
  |         }
  |     }
  | 

Now obviously a user "Foo" can log in with an arbitrary password and any other user gets an "invalid login" message. Everything's fine so far, but interestingly I'm getting two 

anonymous wrote : 
  |  authenticating xxx
  |  Autentication: FALSE
  | 

entries in the log, if a user "xxx" tries to log in - hence the authenticate() method is called twice. 
Could anyone explain to me, why this is the case  - I thought, if an action method returns false, simple the current page is re-rendered.

Thanks a lot for any explanations.

Best regards, Kurt

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

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



More information about the jboss-user mailing list