public final class HttpStatusEntryPoint extends Object implements AuthenticationEntryPoint
AuthenticationEntryPoint
that sends a generic HttpStatus
as a
response. Useful for JavaScript clients which cannot use Basic authentication since the
browser intercepts the response.Constructor and Description |
---|
HttpStatusEntryPoint(HttpStatus httpStatus)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
commence(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationException authException)
Commences an authentication scheme.
|
public HttpStatusEntryPoint(HttpStatus httpStatus)
httpStatus
- the HttpSatus to setpublic void commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException) throws IOException, javax.servlet.ServletException
AuthenticationEntryPoint
ExceptionTranslationFilter
will populate the HttpSession
attribute named
AbstractAuthenticationProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY
with the requested target URL before calling this method.
Implementations should modify the headers on the ServletResponse
as
necessary to commence the authentication process.
commence
in interface AuthenticationEntryPoint
request
- that resulted in an AuthenticationException
response
- so that the user agent can begin authenticationauthException
- that caused the invocationIOException
javax.servlet.ServletException