Which annotation is used to secure methods in Spring Security?
- @Authorize
- @PreAuthorize
- @Secure
- @Secured
The correct annotation to secure methods in Spring Security is @Secured. This annotation allows you to specify which roles or authorities are required to access a particular method.
Loading...
Related Quiz
- In Spring Security, to apply method security, one needs to enable it using the _____ annotation on a configuration class.
- You are working on a Spring Boot application where you need to implement dynamic DataSource routing based on specific conditions. How would you design and implement this functionality?
- How can you implement token enhancement to include custom claims in an OAuth2 JWT token generated by a Spring Boot application?
- In a Spring Boot application, how can you specify that a method parameter should be bound to a web request parameter?
- In Spring Boot, _____ annotation is used to map HTTP POST requests onto specific handler methods.