Jul 26th, 2010, 04:03 AM
SecurityContext working alternately
I am using Spring Security based authentication for our application. Once the user logs in, the authorization checks work flawlessly, but there is an option to switch between the themes, some which have admin access and others non-admin. When user switches for the first time, the authorization works fine but the next switch (if its authorized as admin) doesn't work and throws an "exception : org.springframework.security.access. AccessDeniedException: Access is denied"
For the next switch(admin or non-admin) works fine again, its working subsequently. I am using the following code while switching:
SecurityContextImpl securityContext = new SecurityContextImpl();
securityContext.setAuthentication(result); //result - authentication object
I am using Java 1.5.19, Tomcat 6.0.20, Spring Security 3.0.0 and Spring 3.0.3.
Thanks in advance,
Tags for this Thread