File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Problem in Spring security redirection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Problem in Spring security redirection" Watch "Problem in Spring security redirection" New topic
Author

Problem in Spring security redirection

juniad Ahmed
Greenhorn

Joined: Feb 19, 2011
Posts: 24
Hi,
i have a simple spring application to test spring security feature. only admin can access some url, if some one slse tries to access it it should throw error, but i get the following error " Access is denied (user is anonymous); redirecting to authentication entry point
org.springframework.security.access.AccessDeniedException: Access is denied"


Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Yeah, your login page is secured. So someone who isn't logged in won't get to any page, including the login page, so you can't even login to login.

So when you go to a page that is secured and you are not logged in, one of the SecurityFilters the Authorization one throws an AccessDeniedException. The ExceptionFilter, then tries to redirect to the login page. If no login page is defined it just bubbles up the access denied page.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem in Spring security redirection
 
Similar Threads
problem with spring security
Spring security 3.0
spring security 3.1 login not working.
RequestDispatcher null - cant find /j_spring_security_check
[Spring Security] No bean named 'springSecurityFilterChain' is defined