Skip to main content

Authentication Filter

Learn Authentication Filter (Filters, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Authentication filter is a filter that finds credentials in a request (header, cookie, token), verifies them and marks the request as authenticated or rejects it. In Spring Security the filter puts an Authentication object into the SecurityContextHolder so later code can call getPrincipal . Failure returns 401 Unauthorized before the controller runs.

More lessons in Filters