Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why we should use method security in spring security?

 
sina poores
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new to spring security and i have a question.
why request security is not suffcient for mvc web application and we should use method (pre-post) annotation for security in methods.in other word why we need method security in web application that the only chanel between application and client are request(and response).
thanks alot
 
Rohit Mehta
Ranch Hand
Posts: 79
Chrome Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I feel is that request security provide Authentication (whether you are a valid person to log on / use to system) - where as method level security is a tool which is used to identify whether an user has sufficient privileges (i.e. authorization) to call particular method or not.

It is useful where we have multiple roles & provide functionality restricted as per roles. Authorization is a basic requirement for large apps.

Most of the Enterprise level apps implement authorization in one way or other. Spring has also come up with their way.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohit Mehta wrote:What I feel is that request security provide Authentication (whether you are a valid person to log on / use to system) - where as method level security is a tool which is used to identify whether an user has sufficient privileges (i.e. authorization) to call particular method or not.

It is useful where we have multiple roles & provide functionality restricted as per roles. Authorization is a basic requirement for large apps.

Most of the Enterprise level apps implement authorization in one way or other. Spring has also come up with their way.


In Spring Security it isn't like that.

You have authorization and authentication on both levels.

The reason why you add method security with request security is to protect yourself from a hacker skipping over your URL request and hitting the middle tier server and method of you class directly.

 
Rohit Mehta
Ranch Hand
Posts: 79
Chrome Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clarification Mark!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic