Skip to content

Commit

Permalink
Issue #6553 - give 403 response if UNAUTHENTICATED and auth is mandatory
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Jul 29, 2021
1 parent 5dcc14b commit 40c7934
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -572,6 +572,11 @@ else if (authentication instanceof Authentication.Deferred)
authenticator.secureResponse(request, response, isAuthMandatory, null);
}
}
else if ((authentication == Authentication.UNAUTHENTICATED) && isAuthMandatory)
{
response.sendError(HttpServletResponse.SC_FORBIDDEN, "unauthenticated");
baseRequest.setHandled(true);
}
else
{
baseRequest.setAuthentication(authentication);
Expand Down

0 comments on commit 40c7934

Please sign in to comment.