クラス 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
ネストされたクラスの要約
ネストされたクラスコンストラクターの概要
コンストラクターコンストラクター説明DelegatingAuthenticationEntryPoint(LinkedHashMapSE<RequestMatcher, AuthenticationEntryPoint> entryPoints) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint defaultEntryPoint, ListSE<RequestMatcherEntry<AuthenticationEntryPoint>> entryPoints) 指定されたマッピングを使用して新しいインスタンスを作成します。DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint defaultEntryPoint, RequestMatcherEntry<AuthenticationEntryPoint>... entryPoints) 指定されたマッピングを使用して新しいインスタンスを作成します。メソッドのサマリー
修飾子と型メソッド説明voidbuilder()新しいDelegatingAuthenticationEntryPoint.Builderを作成しますvoidcommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException authException) 認証スキームを開始します。voidsetDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
コンストラクターの詳細
DelegatingAuthenticationEntryPoint
public DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint defaultEntryPoint, RequestMatcherEntry<AuthenticationEntryPoint>... entryPoints) 指定されたマッピングを使用して新しいインスタンスを作成します。- パラメーター:
entryPoints-RequestMatcherからAuthenticationEntryPointへのマッピング。null または空にすることはできません。defaultEntryPoint- デフォルトのAuthenticationEntryPoint。null にすることはできません。
DelegatingAuthenticationEntryPoint
public DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint defaultEntryPoint, ListSE<RequestMatcherEntry<AuthenticationEntryPoint>> entryPoints) 指定されたマッピングを使用して新しいインスタンスを作成します。- パラメーター:
defaultEntryPoint- デフォルトのAuthenticationEntryPoint。null にすることはできません。entryPoints-RequestMatcherからAuthenticationEntryPointへのマッピング。null または空にすることはできません。
DelegatingAuthenticationEntryPoint
@DeprecatedSE(forRemoval=true) public DelegatingAuthenticationEntryPoint(LinkedHashMapSE<RequestMatcher, AuthenticationEntryPoint> entryPoints) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。新しいインスタンスを作成します。- パラメーター:
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- 呼び出しの原因となった例外- 例外:
IOExceptionSEjakarta.servlet.ServletException
setDefaultEntryPoint
@DeprecatedSE(forRemoval=true) public void setDefaultEntryPoint(AuthenticationEntryPoint defaultEntryPoint) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。RequestMatcher が true を返さない場合に使用される EntryPointafterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBeanのafterPropertiesSet
builder
新しいDelegatingAuthenticationEntryPoint.Builderを作成します
DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint, List)を使用