• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

why we should use method security in spring security?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 79
Eclipse IDE Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for clarification Mark!
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic