Using @PreAuthorize on Spring controllers methods
Authenticate controller method using @PreAuthorize annotation : @PreAuthorize annotation is used to provide the method level security. We can secure our methods by using @PreAuthorize annotation. It is very easy to use and it is always preferred over the @Secured annotation.@PreAuthorize is different in a way that it is more powerful than the @Secured. We can use Spring expression language(SpringEL) to validate the method before calling. Here we will show you how we can use the @PreAuthorize annotation in spring controller's method. It is always a good practice that use @PreAuthorize annotation in service methods instead of using methods of controller .
For full Blog of Using @PreAuthorize on Spring controllers methods visit FindNerd.
FindNerd- a social platform for tech nerds allows you to ask questions of all your technical problems. Use FindNerd for the following, increase knowledge, ask tech query, blog post, video post, manage projects, record desktop and share etc.
Advertise on APSense
This advertising space is available.
Post Your Ad Here
Post Your Ad Here
Comments