Class DelegatingAuthenticationEntryPoint
- java.lang.Object
-
- org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,AuthenticationEntryPoint
public class DelegatingAuthenticationEntryPoint extends java.lang.Object implements AuthenticationEntryPoint, org.springframework.beans.factory.InitializingBean
AnAuthenticationEntryPointwhich selects a concreteAuthenticationEntryPointbased on aRequestMatcherevaluation.A configuration might look like this:
<bean id="daep" class="org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint"> <constructor-arg> <map> <entry key="hasIpAddress('192.168.1.0/24') and hasHeader('User-Agent','Mozilla')" value-ref="firstAEP" /> <entry key="hasHeader('User-Agent','MSIE')" value-ref="secondAEP" /> </map> </constructor-arg> <property name="defaultEntryPoint" ref="defaultAEP"/> </bean>This example uses theRequestMatcherEditorwhich creates aELRequestMatcherinstances for the map keys.- Since:
- 3.0.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingAuthenticationEntryPoint(java.util.LinkedHashMap<RequestMatcher,AuthenticationEntryPoint> entryPoints)
-
Method Summary
All 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.voidsetDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint)EntryPoint which is used when no RequestMatcher returned true
-
-
-
Constructor Detail
-
DelegatingAuthenticationEntryPoint
public DelegatingAuthenticationEntryPoint(java.util.LinkedHashMap<RequestMatcher,AuthenticationEntryPoint> entryPoints)
-
-
Method Detail
-
commence
public void commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException) throws java.io.IOException, javax.servlet.ServletExceptionDescription 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 interfaceAuthenticationEntryPoint- Parameters:
request- that resulted in anAuthenticationExceptionresponse- so that the user agent can begin authenticationauthException- that caused the invocation- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
setDefaultEntryPoint
public void setDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint)
EntryPoint which is used when no RequestMatcher returned true
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
-