public class DelegatingAuthenticationEntryPoint extends java.lang.Object implements AuthenticationEntryPoint, org.springframework.beans.factory.InitializingBean
RequestMatcher 評価に基づいて具体的な AuthenticationEntryPoint を選択する AuthenticationEntryPoint。構成は次のようになります。
<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>
この例では、マップキーの ELRequestMatcher インスタンスを作成する RequestMatcherEditor を使用しています。| コンストラクターと説明 |
|---|
DelegatingAuthenticationEntryPoint(java.util.LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints) |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
void | commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException authException) 認証スキームを開始します。 |
void | setDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint)RequestMatcher が true を返さない場合に使用される EntryPoint |
public DelegatingAuthenticationEntryPoint(java.util.LinkedHashMap<RequestMatcher,AuthenticationEntryPoint> entryPoints)
public void commence(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationException authException)
throws java.io.IOException,
javax.servlet.ServletExceptionAuthenticationEntryPointExceptionTranslationFilter は、このメソッドを呼び出す前に、AbstractAuthenticationProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY という名前の HttpSession 属性にリクエストされたターゲット URL を入力します。
実装では、必要に応じて ServletResponse のヘッダーを変更して、認証プロセスを開始する必要があります。
AuthenticationEntryPoint 内の commence request - AuthenticationException が発生したリクエスト response - ユーザーエージェントが認証を開始できるようにする authException - 呼び出しの原因となった例外 java.io.IOExceptionjavax.servlet.ServletExceptionpublic void setDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint)
public void afterPropertiesSet()
org.springframework.beans.factory.InitializingBean 内の afterPropertiesSet