Replace Hardcoded 403 in Http403ForbiddenEntryPoint
with HttpStatus.FORBIDDEN.value()
#16615
Labels
in: web
An issue in web modules (web, webmvc)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Summary
In
BasicAuthenticationEntryPoint
andDelegatingAuthenticationEntryPoint
, HTTP status codes are returned usingHttpStatus.UNAUTHORIZED.value()
.However, in
Http403ForbiddenEntryPoint
, the status code403
is hardcoded.For consistency and maintainability, should we update
Http403ForbiddenEntryPoint
to also useHttpStatus.FORBIDDEN.value()
?Suggested Improvement
To maintain consistency across different authentication entry points,
Http403ForbiddenEntryPoint
could be modified as follows:Current Implementation
BasicAuthenticationEntryPoint
(UsesHttpStatus.UNAUTHORIZED.value()
)DelegatingAuthenticationEntryPoint
(UsesHttpStatus.UNAUTHORIZED.value()
)Http403ForbiddenEntryPoint
(Hardcoded403
)Questions
Http403ForbiddenEntryPoint
does not follow the same pattern asBasicAuthenticationEntryPoint
andDelegatingAuthenticationEntryPoint
?HttpStatus.FORBIDDEN.value()
for better readability and maintainability?The text was updated successfully, but these errors were encountered: