Class BasicAuthenticationEntryPoint
- java.lang.Object
- 
- org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
 
- 
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean,- AuthenticationEntryPoint
 
 public class BasicAuthenticationEntryPoint extends java.lang.Object implements AuthenticationEntryPoint, org.springframework.beans.factory.InitializingBean Used by theExceptionTranslationFilterto commence authentication via theBasicAuthenticationFilter.Once a user agent is authenticated using BASIC authentication, logout requires that the browser be closed or an unauthorized (401) header be sent. The simplest way of achieving the latter is to call the commence(HttpServletRequest, HttpServletResponse, AuthenticationException)method below. This will indicate to the browser its credentials are no longer authorized, causing it to prompt the user to login again.
- 
- 
Constructor SummaryConstructors Constructor Description BasicAuthenticationEntryPoint()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voidcommence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException)Commences an authentication scheme.java.lang.StringgetRealmName()voidsetRealmName(java.lang.String realmName)
 
- 
- 
- 
Method Detail- 
afterPropertiesSetpublic void afterPropertiesSet() - Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
 - 
commencepublic void commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException) throws java.io.IOExceptionDescription copied from interface:AuthenticationEntryPointCommences an authentication scheme.ExceptionTranslationFilterwill populate theHttpSessionattribute namedAbstractAuthenticationProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEYwith the requested target URL before calling this method.Implementations should modify the headers on the ServletResponseas necessary to commence the authentication process.- Specified by:
- commencein interface- AuthenticationEntryPoint
- Parameters:
- request- that resulted in an- AuthenticationException
- response- so that the user agent can begin authentication
- authException- that caused the invocation
- Throws:
- java.io.IOException
 
 - 
getRealmNamepublic java.lang.String getRealmName() 
 - 
setRealmNamepublic void setRealmName(java.lang.String realmName) 
 
- 
 
-