クラス AuthenticationWebFilter

java.lang.ObjectSE
org.springframework.security.web.server.authentication.AuthenticationWebFilter
実装されたすべてのインターフェース:
org.springframework.web.server.WebFilter
既知の直属サブクラス
OAuth2LoginAuthenticationWebFilter

public class AuthenticationWebFilter extends ObjectSE implements org.springframework.web.server.WebFilter
特定のリクエストの認証を実行する WebFilter。ロジックの概要:
導入:
5.0
  • コンストラクターの詳細

    • AuthenticationWebFilter

      public AuthenticationWebFilter(ReactiveAuthenticationManager authenticationManager)
      インスタンスを作成します
      パラメーター:
      authenticationManager - 使用する認証マネージャー
    • AuthenticationWebFilter

      public AuthenticationWebFilter(ReactiveAuthenticationManagerResolver<org.springframework.web.server.ServerWebExchange> authenticationManagerResolver)
      インスタンスを作成します
      パラメーター:
      authenticationManagerResolver - 使用する認証マネージャーリゾルバー
      導入:
      5.3
  • メソッドの詳細

    • filter

      public reactor.core.publisher.Mono<VoidSE> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)
      次で指定:
      インターフェース org.springframework.web.server.WebFilterfilter 
    • onAuthenticationSuccess

      protected reactor.core.publisher.Mono<VoidSE> onAuthenticationSuccess(Authentication authentication, WebFilterExchange webFilterExchange)
    • setSecurityContextRepository

      public void setSecurityContextRepository(ServerSecurityContextRepository securityContextRepository)
      SecurityContext を永続化するためのリポジトリを設定します。デフォルトは NoOpServerSecurityContextRepository です
      パラメーター:
      securityContextRepository - 使用するリポジトリ
    • setAuthenticationSuccessHandler

      public void setAuthenticationSuccessHandler(ServerAuthenticationSuccessHandler authenticationSuccessHandler)
      認証成功ハンドラーを設定します。デフォルトは WebFilterChainServerAuthenticationSuccessHandler です
      パラメーター:
      authenticationSuccessHandler - 使用する成功ハンドラー
    • setAuthenticationConverter

      @DeprecatedSE public void setAuthenticationConverter(FunctionSE<org.springframework.web.server.ServerWebExchange,reactor.core.publisher.Mono<Authentication>> authenticationConverter)
      使用すべきではありません。
      ServerWebExchange から、提供された ReactiveAuthenticationManager での認証に使用される Authentication に変換するために使用される戦略を設定します。結果が空の場合、認証の試行を行わないことを通知します。デフォルトのコンバーターは ServerHttpBasicAuthenticationConverter です
      パラメーター:
      authenticationConverter - 使用するコンバーター
      関連事項:
    • setServerAuthenticationConverter

      public void setServerAuthenticationConverter(ServerAuthenticationConverter authenticationConverter)
      ServerWebExchange から、提供された ReactiveAuthenticationManager での認証に使用される Authentication に変換するために使用される戦略を設定します。結果が空の場合、認証の試行を行わないことを通知します。デフォルトのコンバーターは ServerHttpBasicAuthenticationConverter です
      パラメーター:
      authenticationConverter - 使用するコンバーター
      導入:
      5.1
    • setAuthenticationFailureHandler

      public void setAuthenticationFailureHandler(ServerAuthenticationFailureHandler authenticationFailureHandler)
      認証が失敗したときに使用される失敗ハンドラーを設定します。デフォルトでは、基本認証のプロンプトが表示されます。
      パラメーター:
      authenticationFailureHandler - 使用するハンドラー。null にはできません。
    • setRequiresAuthenticationMatcher

      public void setRequiresAuthenticationMatcher(ServerWebExchangeMatcher requiresAuthenticationMatcher)
      認証する setServerAuthenticationConverter(ServerAuthenticationConverter) から Authentication を作成するときに決定するために使用されるマッチャーを設定します。コンバーターが空の結果を返す場合、認証は試行されません。デフォルトはすべてのリクエストです
      パラメーター:
      requiresAuthenticationMatcher - 使用するマッチャー。null にはできません。