クラス NimbusJwtDecoder.SecretKeyJwtDecoderBuilder
java.lang.ObjectSE
org.springframework.security.oauth2.jwt.NimbusJwtDecoder.SecretKeyJwtDecoderBuilder
- 含まれているクラス:
- NimbusJwtDecoder
SecretKey に基づいて NimbusJwtDecoder インスタンスを作成するためのビルダー。方法の概要
修飾子と型メソッド説明build()構成されたNimbusJwtDecoderをビルドします。jwtProcessorCustomizer(ConsumerSE<com.nimbusds.jwt.proc.ConfigurableJWTProcessor<com.nimbusds.jose.proc.SecurityContext>> jwtProcessorCustomizer) macAlgorithm(MacAlgorithm macAlgorithm) MAC を生成するときは、指定されたアルゴリズムを使用してください。validateType(boolean shouldValidateTypHeader) Nimbus のtypヘッダー検証を使用するかどうか。
メソッドの詳細
validateType
Nimbus のtypヘッダー検証を使用するかどうか。デフォルトはfalseです。この機能をオンにすると、
NimbusJwtDecoderは Nimbus のデフォルトのJOSEObjectTypeVerifierを使用して、typヘッダーのチェックを Nimbus に委譲します。これを
falseに設定すると、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
macAlgorithm
MAC を生成するときは、指定されたアルゴリズムを使用してください。値は HS256、HS384 または HS512 のいずれかである必要があります。- パラメーター:
macAlgorithm- 使用する MAC アルゴリズム- 戻り値:
- さらなる構成のための
NimbusJwtDecoder.SecretKeyJwtDecoderBuilder
jwtProcessorCustomizer
public NimbusJwtDecoder.SecretKeyJwtDecoderBuilder jwtProcessorCustomizer(ConsumerSE<com.nimbusds.jwt.proc.ConfigurableJWTProcessor<com.nimbusds.jose.proc.SecurityContext>> jwtProcessorCustomizer) - パラメーター:
jwtProcessorCustomizer- プロセッサーを変更するために使用されるコールバック- 戻り値:
- さらなる構成のための
NimbusJwtDecoder.SecretKeyJwtDecoderBuilder - 導入:
- 5.4
build
構成されたNimbusJwtDecoderをビルドします。- 戻り値:
- 設定された
NimbusJwtDecoder