[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security ...

Shane Bryzak sbryzak at redhat.com
Wed Jun 20 00:25:01 EDT 2007


  User: sbryzak2
  Date: 07/06/20 00:25:01

  Modified:    src/main/org/jboss/seam/security  Identity.java
  Log:
  don't recursively authenticate
  
  Revision  Changes    Path
  1.91      +18 -5     jboss-seam/src/main/org/jboss/seam/security/Identity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Identity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/Identity.java,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -b -r1.90 -r1.91
  --- Identity.java	20 Jun 2007 03:24:06 -0000	1.90
  +++ Identity.java	20 Jun 2007 04:25:01 -0000	1.91
  @@ -77,6 +77,11 @@
      
      private boolean authenticateEveryRequest = false;
      
  +   /**
  +    * Flag that indicates we are in the process of authenticating
  +    */
  +   private boolean authenticating = false;
  +   
      @Override
      protected String getCookieName()
      {
  @@ -160,7 +165,7 @@
      
      public boolean isLoggedIn(boolean attemptLogin)
      {
  -      if (attemptLogin && getPrincipal() == null && isCredentialsSet() &&
  +      if (!authenticating && attemptLogin && getPrincipal() == null && isCredentialsSet() &&
             Contexts.isEventContextActive() &&
             !Contexts.getEventContext().isSet(LOGIN_TRIED))
         {
  @@ -184,7 +189,7 @@
      
      public boolean isCredentialsSet()
      {
  -      return username != null;
  +      return username != null && password != null;
      }
         
      /**
  @@ -310,10 +315,18 @@
      public void authenticate(LoginContext loginContext) 
         throws LoginException
      {
  +      try
  +      {
  +         authenticating = true;
         preAuthenticate();
         loginContext.login();
         postAuthenticate();
      }
  +      finally
  +      {
  +         authenticating = false;
  +      }
  +   }
      
      protected void preAuthenticate()
      {
  
  
  



More information about the jboss-cvs-commits mailing list