Return to site

🍃🎓 SPRING CERTIFICATION QUESTION: What do @PreAuthorized and @RolesAllowed do? What is the difference between them?

· java,spring

🙆‍♂️Similarities:

Both of these annotations might be used to apply authorization logic at a method level.

Access control for both annotations is applied before method invocation.

 

🙅‍♀️Discrepancies:

RolesAllowed supports only a list of authentications (roles). It's an annotation defined by JSR-250 specification.

PreAuthorize supports SpEL, it's a Spring Security framework annotation.

 

 

#spring #certificationquestion #vcp

 

 

 

All Posts
×

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OK