クラス AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter>
java.lang.ObjectSE
org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<T,B>
org.springframework.security.config.annotation.web.configurers.AbstractAuthenticationFilterConfigurer<B,T,F>
- 型パラメーター:
T
- 現在の構成を返すために "this" を参照しますF
- 構築中のAbstractAuthenticationProcessingFilter
を指します
- 実装されたすべてのインターフェース:
SecurityConfigurer<DefaultSecurityFilterChain,
B>
public abstract class AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter>
extends AbstractHttpConfigurer<T,B>
AbstractAuthenticationFilterConfigurer
を構成するための基本クラス。これは内部使用のみを目的としています。- 導入:
- 3.2
- 関連事項:
コンストラクターのサマリー
コンストラクター修飾子コンストラクター説明protected
最小のデフォルトで新しいインスタンスを作成しますprotected
AbstractAuthenticationFilterConfigurer
(F authenticationFilter, StringSE defaultLoginProcessingUrl) 新しいインスタンスを作成しますメソッドのサマリー
修飾子と型メソッド説明final T
authenticationDetailsSource
(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest, ?> authenticationDetailsSource) カスタムAuthenticationDetailsSource
を指定します。void
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。protected abstract RequestMatcher
createLoginProcessingUrlMatcher
(StringSE loginProcessingUrl) loginProcessingUrl を指定してRequestMatcher
を作成しますfinal T
defaultSuccessUrl
(StringSE defaultSuccessUrl) ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、認証後にユーザーがリダイレクトされる場所を指定します。final T
defaultSuccessUrl
(StringSE defaultSuccessUrl, boolean alwaysUse) ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、またはalwaysUse
が true の場合、認証後にユーザーがリダイレクトされる場所を指定します。final T
failureHandler
(AuthenticationFailureHandler authenticationFailureHandler) 認証が失敗したときに使用するAuthenticationFailureHandler
を指定します。final T
failureUrl
(StringSE authenticationFailureUrl) 認証が失敗した場合にユーザーを送信する URL。protected final AuthenticationEntryPoint
認証エントリポイントを取得しますprotected final RequestMatcher
protected final F
認証フィルターを取得しますprotected final StringSE
認証が失敗した場合にユーザーを送信する URL を取得しますprotected final StringSE
ログインページを取得しますprotected final StringSE
認証リクエストを送信する URL を取得します(つまりvoid
SecurityBuilder
を初期化します。final boolean
protected T
ログインが必要な場合にユーザーを送信する URL を指定します。loginProcessingUrl
(StringSE loginProcessingUrl) 資格情報を検証する URL を指定します。final T
permitAll(true)の呼び出しと同等final T
permitAll
(boolean permitAll) failureUrl(String)
およびHttpSecurityBuilder
、getLoginPage()
およびgetLoginProcessingUrl()
の URL がすべてのユーザーにアクセスを許可されるようにします。protected final void
registerAuthenticationEntryPoint
(B http, AuthenticationEntryPoint authenticationEntryPoint) protected final void
securityContextRepository
(SecurityContextRepository securityContextRepository) protected final void
setAuthenticationFilter
(F authFilter) 認証フィルターを設定しますfinal T
successHandler
(AuthenticationSuccessHandler successHandler) 使用するAuthenticationSuccessHandler
を指定します。protected final void
updateAccessDefaults
(B http) アクセスのデフォルト値を更新します。protected final void
認証のデフォルト値を更新します。クラス org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer から継承されたメソッド
disable, getSecurityContextHolderStrategy, withObjectPostProcessor
クラス org.springframework.security.config.annotation.SecurityConfigurerAdapter から継承されたメソッド
addObjectPostProcessor, and, getBuilder, postProcess, setBuilder
コンストラクターの詳細
AbstractAuthenticationFilterConfigurer
protected AbstractAuthenticationFilterConfigurer()最小のデフォルトで新しいインスタンスを作成しますAbstractAuthenticationFilterConfigurer
protected AbstractAuthenticationFilterConfigurer(F authenticationFilter, StringSE defaultLoginProcessingUrl) 新しいインスタンスを作成します- パラメーター:
authenticationFilter
- 使用するAbstractAuthenticationProcessingFilter
defaultLoginProcessingUrl
-loginProcessingUrl(String)
に使用するデフォルト URL
メソッドの詳細
defaultSuccessUrl
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、defaultSuccessUrl(String, boolean)
を呼び出すためのショートカットです。- パラメーター:
defaultSuccessUrl
- デフォルトの成功 URL- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
defaultSuccessUrl
ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、またはalwaysUse
が true の場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、successHandler(AuthenticationSuccessHandler)
を呼び出すためのショートカットです。- パラメーター:
defaultSuccessUrl
- デフォルトの成功 URLalwaysUse
- 保護されたページに以前にアクセスしたことがあるにもかかわらず、認証後にdefaultSuccessUrl
を使用する必要がある場合は true- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
loginProcessingUrl
資格情報を検証する URL を指定します。- パラメーター:
loginProcessingUrl
- ユーザー名とパスワードを検証する URL- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
securityContextRepository
createLoginProcessingUrlMatcher
loginProcessingUrl を指定してRequestMatcher
を作成します- パラメーター:
loginProcessingUrl
- loginProcessingUrl に基づいてRequestMatcher
を作成します- 戻り値:
- loginProcessingUrl に基づいて使用する
RequestMatcher
authenticationDetailsSource
public final T authenticationDetailsSource(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest, ?> authenticationDetailsSource) カスタムAuthenticationDetailsSource
を指定します。デフォルトはWebAuthenticationDetailsSource
です。- パラメーター:
authenticationDetailsSource
- カスタムAuthenticationDetailsSource
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
successHandler
使用するAuthenticationSuccessHandler
を指定します。デフォルトはSavedRequestAwareAuthenticationSuccessHandler
で、追加のプロパティは設定されていません。- パラメーター:
successHandler
-AuthenticationSuccessHandler
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
permitAll
permitAll(true)の呼び出しと同等- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
permitAll
failureUrl(String)
およびHttpSecurityBuilder
、getLoginPage()
およびgetLoginProcessingUrl()
の URL がすべてのユーザーにアクセスを許可されるようにします。- パラメーター:
permitAll
- URL へのアクセスを許可する場合は true、この手順をスキップする場合は false- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
failureUrl
認証が失敗した場合にユーザーに送信する URL。これは、failureHandler(AuthenticationFailureHandler)
を呼び出すためのショートカットです。デフォルトは "/login?error" です。- パラメーター:
authenticationFailureUrl
- 認証が失敗した場合にユーザーに送信する URL(つまり、"/login?error")。- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
failureHandler
認証が失敗したときに使用するAuthenticationFailureHandler
を指定します。デフォルトでは、SimpleUrlAuthenticationFailureHandler
を使用して "/login?error" にリダイレクトされます- パラメーター:
authenticationFailureHandler
- 認証が失敗したときに使用するAuthenticationFailureHandler
- 戻り値:
- 追加のカスタマイズのための
FormLoginConfigurer
init
インターフェースからコピーされた説明:SecurityConfigurer
SecurityBuilder
を初期化します。ここでは、共有状態のみを作成および変更する必要がありますが、オブジェクトの構築に使用されるSecurityBuilder
のプロパティは作成および変更しないでください。これにより、構築時にSecurityConfigurer.configure(SecurityBuilder)
メソッドが正しい共有オブジェクトを使用するようになります。ここで設定を適用する必要があります。- 次で指定:
- インターフェース
SecurityConfigurer<B extends HttpSecurityBuilder<B>,
のT extends AbstractAuthenticationFilterConfigurer<B, T, F>> init
- オーバーライド:
- クラス
SecurityConfigurerAdapter<DefaultSecurityFilterChain,
のB extends HttpSecurityBuilder<B>> init
- 例外:
ExceptionSE
registerDefaultAuthenticationEntryPoint
registerAuthenticationEntryPoint
protected final void registerAuthenticationEntryPoint(B http, AuthenticationEntryPoint authenticationEntryPoint) getAuthenticationEntryPointMatcher
configure
インターフェースからコピーされた説明:SecurityConfigurer
SecurityBuilder
に必要なプロパティを設定して、SecurityBuilder
を構成します。- 次で指定:
- インターフェース
SecurityConfigurer<B extends HttpSecurityBuilder<B>,
のT extends AbstractAuthenticationFilterConfigurer<B, T, F>> configure
- オーバーライド:
- クラス
SecurityConfigurerAdapter<DefaultSecurityFilterChain,
のB extends HttpSecurityBuilder<B>> configure
- 例外:
ExceptionSE
loginPage
ログインが必要な場合にユーザーを送信する URL を指定します。
EnableWebSecurity
で使用すると、この属性が指定されていない場合にデフォルトのログインページが生成されます。URL が指定されている場合、またはこれが
EnableWebSecurity
と組み合わせて使用されていない場合、ユーザーは指定された URL を処理してログインページを生成する必要があります。isCustomLoginPage
public final boolean isCustomLoginPage()- 戻り値:
- カスタムログインページが指定されている場合は true、それ以外の場合は false
getAuthenticationFilter
認証フィルターを取得します- 戻り値:
- 認証フィルター
setAuthenticationFilter
認証フィルターを設定します- パラメーター:
authFilter
- 認証フィルター
getLoginPage
ログインページを取得します- 戻り値:
- ログインページ
getAuthenticationEntryPoint
認証エントリポイントを取得します- 戻り値:
- 認証エントリポイント
getLoginProcessingUrl
認証リクエストを送信する URL を取得します (つまり、ユーザー名 / パスワードを送信する必要がある場所)- 戻り値:
- 認証リクエストを送信する URL
getFailureUrl
認証が失敗した場合にユーザーを送信する URL を取得します- 戻り値:
- 認証が失敗した場合にユーザーに送信する URL(例: "/login?error")。
updateAuthenticationDefaults
protected final void updateAuthenticationDefaults()認証のデフォルト値を更新します。updateAccessDefaults
アクセスのデフォルト値を更新します。