クラス AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter>

型パラメーター:
T - 現在の構成を返すために "this" を参照します
F - 構築中の AbstractAuthenticationProcessingFilter を指します
実装されたすべてのインターフェース:
SecurityConfigurer<DefaultSecurityFilterChain,B>
既知の直属サブクラス
FormLoginConfigurerOAuth2LoginConfigurerSaml2LoginConfigurer

public abstract class AbstractAuthenticationFilterConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>,F extends AbstractAuthenticationProcessingFilter> extends AbstractHttpConfigurer<T,B>
AbstractAuthenticationFilterConfigurer を構成するための基本クラス。これは内部使用のみを目的としています。
導入:
3.2
関連事項:
  • コンストラクターの詳細

    • AbstractAuthenticationFilterConfigurer

      protected AbstractAuthenticationFilterConfigurer()
      最小のデフォルトで新しいインスタンスを作成します
    • AbstractAuthenticationFilterConfigurer

      protected AbstractAuthenticationFilterConfigurer(F authenticationFilter, StringSE defaultLoginProcessingUrl)
      新しいインスタンスを作成します
      パラメーター:
      authenticationFilter - 使用する AbstractAuthenticationProcessingFilter
      defaultLoginProcessingUrl - loginProcessingUrl(String) に使用するデフォルト URL
  • メソッドの詳細

    • defaultSuccessUrl

      public final T defaultSuccessUrl(StringSE defaultSuccessUrl)
      ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、defaultSuccessUrl(String, boolean) を呼び出すためのショートカットです。
      パラメーター:
      defaultSuccessUrl - デフォルトの成功 URL
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • defaultSuccessUrl

      public final T defaultSuccessUrl(StringSE defaultSuccessUrl, boolean alwaysUse)
      ユーザーが認証前にセキュリティで保護されたページにアクセスしなかった場合、または alwaysUse が true の場合、認証後にユーザーがリダイレクトされる場所を指定します。これは、successHandler(AuthenticationSuccessHandler) を呼び出すためのショートカットです。
      パラメーター:
      defaultSuccessUrl - デフォルトの成功 URL
      alwaysUse - 保護されたページに以前にアクセスしたことがあるにもかかわらず、認証後に defaultSuccessUrl を使用する必要がある場合は true
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • loginProcessingUrl

      public T loginProcessingUrl(StringSE loginProcessingUrl)
      資格情報を検証する URL を指定します。
      パラメーター:
      loginProcessingUrl - ユーザー名とパスワードを検証する URL
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • securityContextRepository

      public T securityContextRepository(SecurityContextRepository securityContextRepository)
    • createLoginProcessingUrlMatcher

      protected abstract RequestMatcher createLoginProcessingUrlMatcher(StringSE loginProcessingUrl)
      loginProcessingUrl を指定して RequestMatcher を作成します
      パラメーター:
      loginProcessingUrl - loginProcessingUrl に基づいて RequestMatcher を作成します
      戻り値:
      loginProcessingUrl に基づいて使用する RequestMatcher
    • authenticationDetailsSource

      public final T authenticationDetailsSource(AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
      カスタム AuthenticationDetailsSource を指定します。デフォルトは WebAuthenticationDetailsSource です。
      パラメーター:
      authenticationDetailsSource - カスタム AuthenticationDetailsSource
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • successHandler

      public final T successHandler(AuthenticationSuccessHandler successHandler)
      使用する AuthenticationSuccessHandler を指定します。デフォルトは SavedRequestAwareAuthenticationSuccessHandler で、追加のプロパティは設定されていません。
      パラメーター:
      successHandler - AuthenticationSuccessHandler
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • permitAll

      public final T permitAll()
      permitAll(true)の呼び出しと同等
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • permitAll

      public final T permitAll(boolean permitAll)
      failureUrl(String) および HttpSecurityBuildergetLoginPage() および getLoginProcessingUrl() の URL がすべてのユーザーにアクセスを許可されるようにします。
      パラメーター:
      permitAll - URL へのアクセスを許可する場合は true、この手順をスキップする場合は false
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • failureUrl

      public final T failureUrl(StringSE authenticationFailureUrl)
      認証が失敗した場合にユーザーに送信する URL。これは、failureHandler(AuthenticationFailureHandler) を呼び出すためのショートカットです。デフォルトは "/login?error" です。
      パラメーター:
      authenticationFailureUrl - 認証が失敗した場合にユーザーに送信する URL(つまり、"/login?error")。
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • failureHandler

      public final T failureHandler(AuthenticationFailureHandler authenticationFailureHandler)
      認証が失敗したときに使用する AuthenticationFailureHandler を指定します。デフォルトでは、SimpleUrlAuthenticationFailureHandler を使用して "/login?error" にリダイレクトされます
      パラメーター:
      authenticationFailureHandler - 認証が失敗したときに使用する AuthenticationFailureHandler
      戻り値:
      追加のカスタマイズのための FormLoginConfigurer
    • init

      public void init(B http) throws ExceptionSE
      インターフェースからコピーされた説明: 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

      protected final void registerDefaultAuthenticationEntryPoint(B http)
    • registerAuthenticationEntryPoint

      protected final void registerAuthenticationEntryPoint(B http, AuthenticationEntryPoint authenticationEntryPoint)
    • getAuthenticationEntryPointMatcher

      protected final RequestMatcher getAuthenticationEntryPointMatcher(B http)
    • configure

      public void configure(B http) throws ExceptionSE
      インターフェースからコピーされた説明: SecurityConfigurer
      SecurityBuilder に必要なプロパティを設定して、SecurityBuilder を構成します。
      次で指定:
      インターフェース SecurityConfigurer<B extends HttpSecurityBuilder<B>,T extends AbstractAuthenticationFilterConfigurer<B,T,F>>configure 
      オーバーライド:
      クラス SecurityConfigurerAdapter<DefaultSecurityFilterChain,B extends HttpSecurityBuilder<B>>configure 
      例外:
      ExceptionSE
    • loginPage

      protected T loginPage(StringSE loginPage)

      ログインが必要な場合にユーザーを送信する URL を指定します。EnableWebSecurity で使用すると、この属性が指定されていない場合にデフォルトのログインページが生成されます。

      URL が指定されている場合、またはこれが EnableWebSecurity と組み合わせて使用されていない場合、ユーザーは指定された URL を処理してログインページを生成する必要があります。

    • isCustomLoginPage

      public final boolean isCustomLoginPage()
      戻り値:
      カスタムログインページが指定されている場合は true、それ以外の場合は false
    • getAuthenticationFilter

      protected final F getAuthenticationFilter()
      認証フィルターを取得します
      戻り値:
      認証フィルター
    • setAuthenticationFilter

      protected final void setAuthenticationFilter(F authFilter)
      認証フィルターを設定します
      パラメーター:
      authFilter - 認証フィルター
    • getLoginPage

      protected final StringSE getLoginPage()
      ログインページを取得します
      戻り値:
      ログインページ
    • getAuthenticationEntryPoint

      protected final AuthenticationEntryPoint getAuthenticationEntryPoint()
      認証エントリポイントを取得します
      戻り値:
      認証エントリポイント
    • getLoginProcessingUrl

      protected final StringSE getLoginProcessingUrl()
      認証リクエストを送信する URL を取得します (つまり、ユーザー名 / パスワードを送信する必要がある場所)
      戻り値:
      認証リクエストを送信する URL
    • getFailureUrl

      protected final StringSE getFailureUrl()
      認証が失敗した場合にユーザーを送信する URL を取得します
      戻り値:
      認証が失敗した場合にユーザーに送信する URL(例: "/login?error")。
    • updateAuthenticationDefaults

      protected final void updateAuthenticationDefaults()
      認証のデフォルト値を更新します。
    • updateAccessDefaults

      protected final void updateAccessDefaults(B http)
      アクセスのデフォルト値を更新します。