[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security/filter ...
Shane Bryzak
Shane_Bryzak at symantec.com
Sun Dec 3 20:06:51 EST 2006
User: sbryzak2
Date: 06/12/03 20:06:51
Modified: src/main/org/jboss/seam/security/filter
SeamSecurityFilter.java
Log:
bye bye old security design
Revision Changes Path
1.11 +18 -64 jboss-seam/src/main/org/jboss/seam/security/filter/SeamSecurityFilter.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamSecurityFilter.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/filter/SeamSecurityFilter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- SeamSecurityFilter.java 25 Oct 2006 15:14:38 -0000 1.10
+++ SeamSecurityFilter.java 4 Dec 2006 01:06:51 -0000 1.11
@@ -1,10 +1,6 @@
package org.jboss.seam.security.filter;
import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.security.auth.login.LoginException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -74,77 +70,35 @@
// Authentication authentication = (Authentication)sessionContext.get(
// "org.jboss.seam.security.Authentication");
-// LoginContext lc = null;
// try
// {
-// Lifecycle.beginInitialization(servletContext);
-//
-// if (authentication != null)
+ chain.doFilter(request, response);
+// }
+// catch (Exception e)
// {
-// AuthenticationContext.instance().setAuthentication(Authenticator.instance().authenticate(authentication));
-// CallbackHandler handler = new UsernamePasswordHandler(
-// authentication.getPrincipal().toString(),
-// authentication.getCredentials());
-// try
+// if (e instanceof ServletException)
// {
-// lc = new LoginContext("client-login", handler);
-// lc.login();
-// }
-// catch (LoginException ex)
+// Throwable cause = ( (ServletException) e).getRootCause();
+//
+// Set<Throwable> causes = new HashSet<Throwable> ();
+// while (cause != null && !causes.contains(cause))
+// {
+// if (cause instanceof LoginException)
// {
-// ex.printStackTrace();
-// }
-// }
-// }
-// catch (AuthenticationException ex) { }
-
- try
- {
- chain.doFilter(request, response);
- }
- catch (Exception e)
- {
- if (e instanceof ServletException)
- {
- Throwable cause = ( (ServletException) e).getRootCause();
-
- Set<Throwable> causes = new HashSet<Throwable> ();
- while (cause != null && !causes.contains(cause))
- {
- if (cause instanceof LoginException)
- {
// Redirect to login page
- log.info("User not logged in... redirecting to login page.");
+// log.info("User not logged in... redirecting to login page.");
/** @todo Redirect based on whatever authentication method is being used */
// SecurityConfig.instance().getAuthenticator().showLogin(hRequest, hResponse);
- break;
- }
- causes.add(cause);
- cause = cause.getCause();
- }
- }
- throw new ServletException(e);
- }
- finally
- {
- // Have to set the application context again because it's probably null
-// Lifecycle.beginInitialization(servletContext);
-
-// AuthenticationContext.instance().setAuthentication(null);
-
-// if (lc != null)
-// {
-// try
-// {
-// lc.logout();
+// break;
// }
-// catch (LoginException ex){ }
+// causes.add(cause);
+// cause = cause.getCause();
+// }
+// }
+// throw new ServletException(e);
// }
-
- /** @todo Clear the application context somewhere here */
- }
}
public void destroy()
More information about the jboss-cvs-commits
mailing list