diff --git a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java index 0b3c526d65..df5b546ce0 100644 --- a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java +++ b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java @@ -73,7 +73,7 @@ public final class AuthenticationHelper /** public service bean IDs **/ private static final String AUTHENTICATION_SERVICE = "AuthenticationService"; - private static final String UNPROTECTED_AUTH_SERVICE = "authenticationService"; + private static final String UNPROTECTED_AUTH_SERVICE = "authenticationServiceImpl"; private static final String PERSON_SERVICE = "personService"; /** cookie names */ @@ -172,15 +172,17 @@ public final class AuthenticationHelper catch (AccessDeniedException accessError) { // Guest is unable to access either properties on Person - //AuthenticationService smallAuth = (AuthenticationService)wc.getBean(UNPROTECTED_AUTH_SERVICE); - //smallAuth.invalidateTicket(smallAuth.getCurrentTicket()); + AuthenticationService unprotAuthService = (AuthenticationService)wc.getBean(UNPROTECTED_AUTH_SERVICE); + unprotAuthService.invalidateTicket(unprotAuthService.getCurrentTicket()); + unprotAuthService.clearCurrentSecurityContext(); logger.warn("Unable to login as Guest: " + accessError.getMessage()); } catch (Throwable e) { // Some other kind of serious failure to report - //AuthenticationService smallAuth = (AuthenticationService)wc.getBean(UNPROTECTED_AUTH_SERVICE); - //smallAuth.invalidateTicket(smallAuth.getCurrentTicket()); + AuthenticationService unprotAuthService = (AuthenticationService)wc.getBean(UNPROTECTED_AUTH_SERVICE); + unprotAuthService.invalidateTicket(unprotAuthService.getCurrentTicket()); + unprotAuthService.clearCurrentSecurityContext(); throw new AlfrescoRuntimeException("Failed to authenticate as Guest user.", e); } finally diff --git a/source/java/org/alfresco/web/bean/LoginBean.java b/source/java/org/alfresco/web/bean/LoginBean.java index 8ac8d62899..f2fdd88de3 100644 --- a/source/java/org/alfresco/web/bean/LoginBean.java +++ b/source/java/org/alfresco/web/bean/LoginBean.java @@ -367,6 +367,7 @@ public class LoginBean if (user != null) { this.authenticationService.invalidateTicket(user.getTicket()); + this.authenticationService.clearCurrentSecurityContext(); } // Request that the username cookie state is removed - this is not