I am using Spring Rest API, and i want to apply custom validation (To be more specific, i want to check user authenticated or not so for that i need HttpServletRequest
object also) before going inside the rest api query.
For example, I have 3 APIs. 1. RestAPI/test1 2. RestAPI/test2 3. RestAPI/test3
so before doing the query, I want to check that user is authenticated or not.
Can i use ConstraintValidator
?
How can i achieve this?
I am not using spring boot...
Thanks!