public class

DelegatingAuthenticationEntryPoint

extends Object
implements InitializingBean AuthenticationEntryPoint
java.lang.Object
   ↳ org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint

Class Overview

An AuthenticationEntryPoint which selects a concrete AuthenticationEntryPoint based on a RequestMatcher evaluation.

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 the RequestMatcherEditor which creates a ELRequestMatcher instances for the map keys.

Summary

Public Constructors
DelegatingAuthenticationEntryPoint(LinkedHashMap<RequestMatcherAuthenticationEntryPoint> entryPoints)
Public Methods
void afterPropertiesSet()
void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)
Commences an authentication scheme.
void setDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint)
EntryPoint which is used when no RequestMatcher returned true
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.security.web.AuthenticationEntryPoint

Public Constructors

public DelegatingAuthenticationEntryPoint (LinkedHashMap<RequestMatcherAuthenticationEntryPoint> entryPoints)

Public Methods

public void afterPropertiesSet ()

Throws
Exception

public void commence (HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)

Commences an authentication scheme.

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.

Parameters
request that resulted in an AuthenticationException
response so that the user agent can begin authentication
authException that caused the invocation
Throws
IOException
ServletException

public void setDefaultEntryPoint (AuthenticationEntryPoint defaultEntryPoint)

EntryPoint which is used when no RequestMatcher returned true