When we use the auth_request directive of nginx for authentication, it does not check the status code of the HTTP response body, it only cares about the status code of the HTTP response
- Application-level status codes: Status codes encapsulated in Result objects are included in the body of the HTTP response when responding
- Non-application-level HTTP status codes: Using ResponseEntity objects, where the HTTP status code is part of the HTTP response and is sent separately, before any HTTP response body
Even if the returned Result object contains a "403" status code, the request was actually successful, so the Nginx auth_request directive will still consider the verification successful