When using @Secured annotation, what is the format to specify the required authority?
- @Secured("ADMIN")
- @Secured("ROLE_ADMIN")
- @Secured("authority.ADMIN")
- @Secured("hasAuthority('ADMIN')")
The correct format to specify the required authority using the @Secured annotation is @Secured("ROLE_ADMIN"). The "ROLE_" prefix is typically used to specify roles. The other options are not the correct format.
Loading...
Related Quiz
- Which annotation is used to define a bean that holds the business logic in a Spring Boot application?
- What is the significance of Garbage Collection optimization in Spring Boot, and how can it impact application performance?
- How can you create a custom Auto Configuration in Spring Boot?
- How can CSRF protection be customized or disabled in Spring Security?
- How can you implement token enhancement to include custom claims in an OAuth2 JWT token generated by a Spring Boot application?