クラス NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder

java.lang.ObjectSE
org.springframework.security.oauth2.jwt.NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder
含まれているクラス:
NimbusReactiveJwtDecoder

public static final class NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder extends ObjectSE
NimbusReactiveJwtDecoder インスタンスを作成するためのビルダー。
導入:
5.2
  • メソッドの詳細

    • jwsAlgorithm

      指定された署名アルゴリズムを使用します。
      パラメーター:
      jwsAlgorithm - 使用するアルゴリズム
      戻り値:
      さらなる構成のための NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder
    • validateType

      public NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder validateType(boolean shouldValidateTypHeader)
      Nimbus の typ ヘッダー検証を使用するかどうか。デフォルトでは true ですが、将来のメジャーリリースで false に変更される可能性があります。

      この機能をオフにすると、NimbusReactiveJwtDecoder は、どのような検証が必要かを判断するために、アプリケーションが typ ヘッダーを自らチェックすることを期待します。

      これは、JwtValidators を使用してバリデーターを構築するときに自動的に実行されます。

      つまり、これは:  NimbusReactiveJwtDecoder jwtDecoder = NimbusReactiveJwtDecoder.withJwkSource(issuer).build(); jwtDecoder.setJwtValidator(JwtValidators.createDefaultWithIssuer(issuer);

      これはこれと同等である:  NimbusReactiveJwtDecoder jwtDecoder = NimbusReactiveJwtDecoder.withJwkSource(key) .validateType(false) .build(); jwtDecoder.setJwtValidator(JwtValidators.createDefaultWithValidators( new JwtIssuerValidator(issuer), JwtTypeValidator.jwt());

      違いは、これを false に設定することで、at+jwt の場合のように型による検証が可能になることです:  NimbusReactiveJwtDecoder jwtDecoder = NimbusReactiveJwtDecoder.withJwkSource(key) .validateType(false) .build(); jwtDecoder.setJwtValidator(new MyAtJwtValidator());

      パラメーター:
      shouldValidateTypHeader - Nimbus が typ ヘッダーを検証するかどうか
      戻り値:
      さらなる構成のための NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder
      導入:
      6.5
    • jwtProcessorCustomizer

      public NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder jwtProcessorCustomizer(ConsumerSE<com.nimbusds.jwt.proc.ConfigurableJWTProcessor<com.nimbusds.jose.proc.JWKSecurityContext>> jwtProcessorCustomizer)
      指定された ConsumerSE を使用して、ビルド NimbusReactiveJwtDecoder に渡す前に ConfigurableJWTProcessor をカスタマイズします。
      パラメーター:
      jwtProcessorCustomizer - プロセッサーを変更するために使用されるコールバック
      戻り値:
      さらなる構成のための NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder
      導入:
      5.4
    • build

      public NimbusReactiveJwtDecoder build()
      構成された NimbusReactiveJwtDecoder をビルドします。
      戻り値:
      設定された NimbusReactiveJwtDecoder