クラス NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder

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

public static final class NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder extends ObjectSE
JWK セット uri に基づいて NimbusJwtDecoder インスタンスを作成するためのビルダー。
  • メソッドの詳細

    • validateType

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

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

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

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

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

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

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

      public NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm)
      指定された署名アルゴリズムを、使用するアルゴリズムのセットに追加します。
      パラメーター:
      signatureAlgorithm - 使用するアルゴリズム
      戻り値:
      さらなる構成のための NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
    • jwsAlgorithms

      public NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder jwsAlgorithms(ConsumerSE<SetSE<SignatureAlgorithm>> signatureAlgorithmsConsumer)
      指定された ConsumerSE で使用するアルゴリズムのリストを構成します。
      パラメーター:
      signatureAlgorithmsConsumer - アルゴリズムリストをさらに構成するための ConsumerSE
      戻り値:
      さらなる構成のための NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
    • restOperations

      public NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder restOperations(org.springframework.web.client.RestOperations restOperations)
      認証サーバーと連携するために与えられた RestOperations を使用してだけでなく、JWK セットの URI で示された発行者
      パラメーター:
      restOperations - 使用する RestOperations インスタンス
      戻り値:
      さらなる構成のための NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
    • cache

      public NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder cache(org.springframework.cache.Cache cache)
      指定された Cache を使用して JWK セットを格納します。
      パラメーター:
      cache - JWK セットの格納に使用される Cache 
      戻り値:
      さらなる構成のための NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
      導入:
      5.4
    • jwtProcessorCustomizer

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

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