クラス ExceptionHandlingConfigurer<H extends HttpSecurityBuilder<H>>
java.lang.ObjectSE
org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer < ExceptionHandlingConfigurer <H>、H>
org.springframework.security.config.annotation.web.configurers.ExceptionHandlingConfigurer<H>
- 実装されたすべてのインターフェース:
SecurityConfigurer<DefaultSecurityFilterChain,
H>
public final class ExceptionHandlingConfigurer<H extends HttpSecurityBuilder<H>>
extends AbstractHttpConfigurer<ExceptionHandlingConfigurer<H>,H>
Spring Security 関連の例外の例外処理をアプリケーションに追加します。すべてのプロパティには適切なデフォルトがあるため、この
SecurityConfigurer
を適用する以外に追加の構成は必要ありません。セキュリティフィルター
次のフィルターが読み込まれます作成された共有オブジェクト
共有オブジェクトは作成されません。使用される共有オブジェクト
次の共有オブジェクトが使用されます。- 明示的な
RequestCache
が提供されない場合、RequestCache
共有オブジェクトを使用して、認証が成功した後にリクエストを再生します AuthenticationEntryPoint
-authenticationEntryPoint(AuthenticationEntryPoint)
を参照
- 導入:
- 3.2
コンストラクターのサマリー
コンストラクター方法の概要
修飾子と型メソッド説明accessDeniedHandler
(AccessDeniedHandler accessDeniedHandler) 使用するAccessDeniedHandler
を指定しますaccessDeniedPage
(StringSE accessDeniedUrl) 使用するAccessDeniedHandler
を指定するショートカットは特定のエラーページですauthenticationEntryPoint
(AuthenticationEntryPoint authenticationEntryPoint) 使用するAuthenticationEntryPoint
を設定します。void
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。defaultAccessDeniedHandlerFor
(AccessDeniedHandler deniedHandler, RequestMatcher preferredMatcher) 指定されたRequestMatcher
に対して呼び出されることを優先するデフォルトのAccessDeniedHandler
を使用するように設定します。defaultAuthenticationEntryPointFor
(AuthenticationEntryPoint entryPoint, RequestMatcher preferredMatcher) 指定されたRequestMatcher
に対して呼び出されることを優先するデフォルトのAuthenticationEntryPoint
を使用するように設定します。クラス org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer から継承されたメソッド
disable, getSecurityContextHolderStrategy, withObjectPostProcessor, withObjectPostProcessor
クラス org.springframework.security.config.annotation.SecurityConfigurerAdapter から継承されたメソッド
addObjectPostProcessor, addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder
コンストラクターの詳細
ExceptionHandlingConfigurer
public ExceptionHandlingConfigurer()新しいインスタンスを作成します
メソッドの詳細
accessDeniedPage
使用するAccessDeniedHandler
を指定するショートカットは特定のエラーページです- パラメーター:
accessDeniedUrl
- アクセス拒否ページの URL (つまり、/errors/401)- 戻り値:
- さらにカスタマイズするための
ExceptionHandlingConfigurer
- 関連事項:
accessDeniedHandler
使用するAccessDeniedHandler
を指定します- パラメーター:
accessDeniedHandler
- 使用するAccessDeniedHandler
- 戻り値:
- さらにカスタマイズするための
ExceptionHandlingConfigurer
defaultAccessDeniedHandlerFor
public ExceptionHandlingConfigurer<H> defaultAccessDeniedHandlerFor(AccessDeniedHandler deniedHandler, RequestMatcher preferredMatcher) 使用するデフォルトのAccessDeniedHandler
を設定します。これは、提供されたRequestMatcher
に対して呼び出されることを優先します。デフォルトのAccessDeniedHandler
が 1 つだけ指定されている場合は、デフォルトのAccessDeniedHandler
に使用されます。複数のデフォルトAccessDeniedHandler
インスタンスが構成されている場合、RequestMatcherDelegatingAccessDeniedHandler
が使用されます。- パラメーター:
deniedHandler
- 使用するAccessDeniedHandler
preferredMatcher
- このデフォルトAccessDeniedHandler
のRequestMatcher
- 戻り値:
- さらにカスタマイズするための
ExceptionHandlingConfigurer
- 導入:
- 5.1
authenticationEntryPoint
public ExceptionHandlingConfigurer<H> authenticationEntryPoint(AuthenticationEntryPoint authenticationEntryPoint) 使用するAuthenticationEntryPoint
を設定します。authenticationEntryPoint(AuthenticationEntryPoint)
が指定されていない場合は、defaultAuthenticationEntryPointFor(AuthenticationEntryPoint, RequestMatcher)
が使用されます。一致が見つからなかった場合、最初のAuthenticationEntryPoint
がデフォルトとして使用されます。それが提供されない場合、デフォルトは
Http403ForbiddenEntryPoint
になります。- パラメーター:
authenticationEntryPoint
- 使用するAuthenticationEntryPoint
- 戻り値:
- さらにカスタマイズするための
ExceptionHandlingConfigurer
defaultAuthenticationEntryPointFor
public ExceptionHandlingConfigurer<H> defaultAuthenticationEntryPointFor(AuthenticationEntryPoint entryPoint, RequestMatcher preferredMatcher) 使用するデフォルトのAuthenticationEntryPoint
を設定します。これは、提供されたRequestMatcher
に対して呼び出されることを優先します。デフォルトのAuthenticationEntryPoint
が 1 つだけ指定されている場合は、デフォルトのAuthenticationEntryPoint
に使用されます。複数のデフォルトAuthenticationEntryPoint
インスタンスが構成されている場合、DelegatingAuthenticationEntryPoint
が使用されます。- パラメーター:
entryPoint
- 使用するAuthenticationEntryPoint
preferredMatcher
- このデフォルトAuthenticationEntryPoint
のRequestMatcher
- 戻り値:
- さらにカスタマイズするための
ExceptionHandlingConfigurer
configure
インターフェースからコピーされた説明:SecurityConfigurer
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。- 次で指定:
- インターフェース
SecurityConfigurer<DefaultSecurityFilterChain,
のH extends HttpSecurityBuilder<H>> configure
- オーバーライド:
- クラス
SecurityConfigurerAdapter<DefaultSecurityFilterChain,
のH extends HttpSecurityBuilder<H>> configure