[jboss-cvs] jboss-seam/examples/security/src/org/jboss/seam/example/security ...

Shane Bryzak Shane_Bryzak at symantec.com
Fri Aug 4 22:00:55 EDT 2006


  User: sbryzak2
  Date: 06/08/04 22:00:55

  Modified:    examples/security/src/org/jboss/seam/example/security     
                        AuthenticatorAction.java LoginAction.java
                        ProtectedAction.java ProtectedLocal.java User.java
  Log:
  Removed servlet filter, updated to work with security changes
  
  Revision  Changes    Path
  1.4       +2 -10     jboss-seam/examples/security/src/org/jboss/seam/example/security/AuthenticatorAction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AuthenticatorAction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/AuthenticatorAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- AuthenticatorAction.java	2 Aug 2006 01:06:11 -0000	1.3
  +++ AuthenticatorAction.java	5 Aug 2006 02:00:55 -0000	1.4
  @@ -13,7 +13,6 @@
   /**
    *
    * @author Shane Bryzak
  - * @version 1.0
    */
   @Name("authenticatorAction")
   public class AuthenticatorAction implements AuthenticationProvider
  @@ -37,10 +36,8 @@
         for (Role role : user.getRoles())
           roles[idx++] = role.getRole();
   
  -      UsernamePasswordToken token = new UsernamePasswordToken(
  -        authentication.getPrincipal(), authentication.getCredentials(), roles);
  -
  -      return token;
  +      return new UsernamePasswordToken(authentication.getPrincipal(),
  +                                       authentication.getCredentials(), roles);
       }
       catch (NoResultException ex)
       {
  @@ -51,9 +48,4 @@
         throw new AuthenticationException("Unknown authentication error", ex);
       }
     }
  -
  -  public void unauthenticate(Authentication authentication)
  -  {
  -
  -  }
   }
  
  
  
  1.6       +2 -11     jboss-seam/examples/security/src/org/jboss/seam/example/security/LoginAction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LoginAction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/LoginAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- LoginAction.java	2 Aug 2006 01:06:11 -0000	1.5
  +++ LoginAction.java	5 Aug 2006 02:00:55 -0000	1.6
  @@ -2,15 +2,11 @@
   
   import javax.ejb.Stateless;
   
  -import static org.jboss.seam.ScopeType.SESSION;
   import org.jboss.seam.annotations.In;
   import org.jboss.seam.annotations.Name;
   import org.jboss.seam.annotations.Out;
  -import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.core.FacesMessages;
  -import org.jboss.seam.security.Authentication;
   import org.jboss.seam.security.AuthenticationException;
  -import org.jboss.seam.security.UsernamePasswordToken;
   import org.jboss.seam.security.authenticator.Authenticator;
   
   /**
  @@ -22,17 +18,13 @@
   @Name("login")
   public class LoginAction implements LoginLocal
   {
  -  @In(value = "org.jboss.seam.security.Authenticator") Authenticator authenticator;
  -  @Out(value = "org.jboss.seam.security.Authentication", scope = SESSION, required = false) Authentication authentication;
  -
     @In(required = false) @Out(required = false) User user;
   
     public String login()
     {
  -    authentication = new UsernamePasswordToken(user.getUsername(), user.getPassword());
       try
       {
  -      authenticator.authenticate(authentication);
  +      Authenticator.instance().authenticate(user.getUsername(), user.getPassword());
         return "success";
       }
       catch (AuthenticationException ex)
  @@ -44,8 +36,7 @@
   
     public String logout()
     {
  -    authentication = null;
  -    Contexts.getSessionContext().remove("org.jboss.seam.security.Authentication");
  +    Authenticator.instance().unauthenticateSession();
       return "login";
     }
   }
  
  
  
  1.4       +1 -4      jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedAction.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ProtectedAction.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- ProtectedAction.java	1 Aug 2006 02:07:06 -0000	1.3
  +++ ProtectedAction.java	5 Aug 2006 02:00:55 -0000	1.4
  @@ -3,15 +3,12 @@
   import javax.annotation.security.RolesAllowed;
   import javax.ejb.Stateless;
   
  -import org.jboss.seam.annotations.Name;
   import org.jboss.annotation.security.SecurityDomain;
  +import org.jboss.seam.annotations.Name;
   
   /**
  - * <p>PROPRIETARY/CONFIDENTIAL Use of this product is subject to license terms.
  - * Copyright (c) 2006 Symantec Corporation. All rights reserved.</p>
    *
    * @author Shane Bryzak
  - * @version 1.0
    */
   @Stateless
   @Name("protectedAction")
  
  
  
  1.2       +0 -3      jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedLocal.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ProtectedLocal.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/ProtectedLocal.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ProtectedLocal.java	25 Jul 2006 06:56:16 -0000	1.1
  +++ ProtectedLocal.java	5 Aug 2006 02:00:55 -0000	1.2
  @@ -1,11 +1,8 @@
   package org.jboss.seam.example.security;
   
   /**
  - * <p>PROPRIETARY/CONFIDENTIAL Use of this product is subject to license terms.
  - * Copyright (c) 2006 Symantec Corporation. All rights reserved.</p>
    *
    * @author Shane Bryzak
  - * @version 1.0
    */
   public interface ProtectedLocal
   {
  
  
  
  1.3       +0 -3      jboss-seam/examples/security/src/org/jboss/seam/example/security/User.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: User.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/security/src/org/jboss/seam/example/security/User.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- User.java	26 Jul 2006 06:03:14 -0000	1.2
  +++ User.java	5 Aug 2006 02:00:55 -0000	1.3
  @@ -9,11 +9,8 @@
   import javax.persistence.JoinColumn;
   
   /**
  - * <p>PROPRIETARY/CONFIDENTIAL Use of this product is subject to license terms.
  - * Copyright (c) 2006 Symantec Corporation. All rights reserved.</p>
    *
    * @author Shane Bryzak
  - * @version 1.0
    */
   @Entity
   @Name("user")
  
  
  



More information about the jboss-cvs-commits mailing list