クラス NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
- 含まれているクラス:
- NimbusJwtDecoder
NimbusJwtDecoder
インスタンスを作成するためのビルダー。メソッドのサマリー
修飾子と型メソッド説明build()
構成されたNimbusJwtDecoder
をビルドします。cache
(org.springframework.cache.Cache cache) 指定されたCache
を使用して JWK セットを格納します。jwsAlgorithm
(SignatureAlgorithm signatureAlgorithm) 指定された署名アルゴリズムを、使用するアルゴリズムのセットに追加します。jwsAlgorithms
(ConsumerSE<SetSE<SignatureAlgorithm>> signatureAlgorithmsConsumer) 指定されたConsumer
SE で使用するアルゴリズムのリストを構成します。jwtProcessorCustomizer
(ConsumerSE<com.nimbusds.jwt.proc.ConfigurableJWTProcessor<com.nimbusds.jose.proc.SecurityContext>> jwtProcessorCustomizer) restOperations
(org.springframework.web.client.RestOperations restOperations) validateType
(boolean shouldValidateTypHeader) Nimbus の typ ヘッダー検証を使用するかどうか。
メソッドの詳細
validateType
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) 指定されたConsumer
SE で使用するアルゴリズムのリストを構成します。- パラメーター:
signatureAlgorithmsConsumer
- アルゴリズムリストをさらに構成するためのConsumer
SE- 戻り値:
- さらなる構成のための
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
restOperations
public NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder restOperations(org.springframework.web.client.RestOperations restOperations) - パラメーター:
restOperations
- 使用するRestOperations
インスタンス- 戻り値:
- さらなる構成のための
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
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) - パラメーター:
jwtProcessorCustomizer
- プロセッサーを変更するために使用されるコールバック- 戻り値:
- さらなる構成のための
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder
- 導入:
- 5.4
build
構成されたNimbusJwtDecoder
をビルドします。- 戻り値:
- 設定された
NimbusJwtDecoder