From c7dcceb05c687636864bbec3e1fb1abd4ad24c86 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Thu, 8 Sep 2005 09:32:24 +0000 Subject: [PATCH] Do not setAuthenticated(false) in the event of a public (unsecured) invocation. Thanks to Joseph Dane for reporting this issue on acegisecurity-developer on 3 September 2005. --- .../intercept/AbstractSecurityInterceptor.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/core/src/main/java/org/acegisecurity/intercept/AbstractSecurityInterceptor.java b/core/src/main/java/org/acegisecurity/intercept/AbstractSecurityInterceptor.java index 3cbcfe8303..e916dc47d9 100644 --- a/core/src/main/java/org/acegisecurity/intercept/AbstractSecurityInterceptor.java +++ b/core/src/main/java/org/acegisecurity/intercept/AbstractSecurityInterceptor.java @@ -466,19 +466,6 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean, this.context.publishEvent(new PublicInvocationEvent(object)); - // Set Authentication object (if it exists) to be unauthenticated - if (SecurityContextHolder.getContext().getAuthentication() != null) { - if (logger.isDebugEnabled()) { - logger.debug( - "Authentication object detected and tagged as unauthenticated"); - } - - Authentication authenticated = SecurityContextHolder.getContext() - .getAuthentication(); - authenticated.setAuthenticated(false); - SecurityContextHolder.getContext().setAuthentication(authenticated); - } - return null; // no further work post-invocation } }