クラス DelegatingAuthenticationEntryPoint
java.lang.ObjectSE
org.springframework.security.web.authentication.DelegatingAuthenticationEntryPoint
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.InitializingBean
,AuthenticationEntryPoint
public class DelegatingAuthenticationEntryPoint
extends ObjectSE
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
を使用しています。- 導入:
- 3.0.2
コンストラクターの概要
コンストラクターコンストラクター説明メソッドのサマリー
修飾子と型メソッド説明void
void
commence
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authException) 認証スキームを開始します。void
setDefaultEntryPoint
(AuthenticationEntryPoint defaultEntryPoint) RequestMatcher が true を返さない場合に使用される EntryPoint
コンストラクターの詳細
DelegatingAuthenticationEntryPoint
public DelegatingAuthenticationEntryPoint(LinkedHashMapSE<RequestMatcher, AuthenticationEntryPoint> entryPoints)
メソッドの詳細
commence
public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authException) throws IOExceptionSE, jakarta.servlet.ServletException インターフェースからコピーされた説明:AuthenticationEntryPoint
認証スキームを開始します。ExceptionTranslationFilter
は、このメソッドを呼び出す前に、AbstractAuthenticationProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY
という名前のHttpSession
属性にリクエストされたターゲット URL を入力します。実装では、必要に応じて
ServletResponse
のヘッダーを変更して、認証プロセスを開始する必要があります。- 次で指定:
- インターフェース
AuthenticationEntryPoint
のcommence
- パラメーター:
request
-AuthenticationException
が発生したリクエストresponse
- ユーザーエージェントが認証を開始できるようにするauthException
- 呼び出しの原因となった例外- 例外:
IOExceptionSE
jakarta.servlet.ServletException
setDefaultEntryPoint
RequestMatcher が true を返さない場合に使用される EntryPointafterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean
のafterPropertiesSet