Class HttpStatusEntryPoint
- java.lang.Object
-
- org.springframework.security.web.authentication.HttpStatusEntryPoint
-
- All Implemented Interfaces:
AuthenticationEntryPoint
public final class HttpStatusEntryPoint extends java.lang.Object implements AuthenticationEntryPoint
AnAuthenticationEntryPoint
that sends a genericHttpStatus
as a response. Useful for JavaScript clients which cannot use Basic authentication since the browser intercepts the response.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description HttpStatusEntryPoint(org.springframework.http.HttpStatus httpStatus)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException)
Commences an authentication scheme.
-
-
-
Method Detail
-
commence
public void commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException)
Description copied from interface:AuthenticationEntryPoint
Commences an authentication scheme.ExceptionTranslationFilter
will populate theHttpSession
attribute namedAbstractAuthenticationProcessingFilter.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.- Specified by:
commence
in interfaceAuthenticationEntryPoint
- Parameters:
request
- that resulted in anAuthenticationException
response
- so that the user agent can begin authenticationauthException
- that caused the invocation
-
-