クラス NimbusReactiveJwtDecoder
- java.lang.Object
-
- org.springframework.security.oauth2.jwt.NimbusReactiveJwtDecoder
- 実装済みのインターフェース一覧:
ReactiveJwtDecoder
public final class NimbusReactiveJwtDecoder extends java.lang.Object implements ReactiveJwtDecoder
「デコード」するReactiveJwtDecoderの実装。JSON Web トークン(JWT)。さらに、JWT が JSON Web 署名(JWS)である場合、そのデジタル署名を検証します。注意 : この実装では、Nimbus JOSE + JWT SDK を内部的に使用します。
- 導入:
- 5.1
- 関連事項:
ReactiveJwtDecoder, JSON Web トークン (JWT) , JSON Web 署名 (JWS) , JSON Web キー (JWK) , Nimbus JOSE + JWT SDK
ネストされたクラスの概要
ネストされたクラス 修飾子と型 クラス 説明 static classNimbusReactiveJwtDecoder.JwkSetUriReactiveJwtDecoderBuilderJWK セット uri に基づいてNimbusReactiveJwtDecoderインスタンスを作成するためのビルダー。static classNimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilderNimbusReactiveJwtDecoderインスタンスを作成するためのビルダー。static classNimbusReactiveJwtDecoder.PublicKeyReactiveJwtDecoderBuilder公開鍵に基づいてNimbusReactiveJwtDecoderインスタンスを作成するためのビルダー。static classNimbusReactiveJwtDecoder.SecretKeyReactiveJwtDecoderBuilderSecretKeyに基づいてNimbusReactiveJwtDecoderインスタンスを作成するためのビルダー。
コンストラクター概要
コンストラクター コンストラクター 説明 NimbusReactiveJwtDecoder(java.lang.String jwkSetUrl)指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。NimbusReactiveJwtDecoder(java.security.interfaces.RSAPublicKey publicKey)指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。NimbusReactiveJwtDecoder(org.springframework.core.convert.converter.Converter<com.nimbusds.jwt.JWT,reactor.core.publisher.Mono<com.nimbusds.jwt.JWTClaimsSet>> jwtProcessor)指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。
方法の概要
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 reactor.core.publisher.Mono<Jwt>decode(java.lang.String token)JWT をそのコンパクトなクレーム表現形式からデコードし、Jwtを返します。voidsetClaimSetConverter(org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>> claimSetConverter)JWT のクレームセットを操作するには、次のConverterを使用しますvoidsetJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)付属のOAuth2TokenValidatorを使用して、受信Jwtを検証します。static NimbusReactiveJwtDecoder.JwkSetUriReactiveJwtDecoderBuilderwithJwkSetUri(java.lang.String jwkSetUri)指定された JWK セット uri を使用して、JWT を検証します。static NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilderwithJwkSource(java.util.function.Function<com.nimbusds.jwt.SignedJWT,reactor.core.publisher.Flux<com.nimbusds.jose.jwk.JWK>> source)指定されたFunctionを使用して JWT を検証しますstatic NimbusReactiveJwtDecoder.PublicKeyReactiveJwtDecoderBuilderwithPublicKey(java.security.interfaces.RSAPublicKey key)指定された公開鍵を使用して JWT を検証しますstatic NimbusReactiveJwtDecoder.SecretKeyReactiveJwtDecoderBuilderwithSecretKey(javax.crypto.SecretKey secretKey)指定されたSecretKeyを使用して、JSON Web 署名(JWS)の MAC を検証します。
コンストラクターの詳細
NimbusReactiveJwtDecoder
public NimbusReactiveJwtDecoder(java.lang.String jwkSetUrl)
指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。- パラメーター:
jwkSetUrl- JSON Web キー(JWK)セットURL
NimbusReactiveJwtDecoder
public NimbusReactiveJwtDecoder(java.security.interfaces.RSAPublicKey publicKey)
指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。- パラメーター:
publicKey- 署名の検証に使用されるRSAPublicKey- 導入:
- 5.2
NimbusReactiveJwtDecoder
public NimbusReactiveJwtDecoder(org.springframework.core.convert.converter.Converter<com.nimbusds.jwt.JWT,reactor.core.publisher.Mono<com.nimbusds.jwt.JWTClaimsSet>> jwtProcessor)
指定されたパラメーターを使用してNimbusReactiveJwtDecoderを構築します。- パラメーター:
jwtProcessor- 署名された Jwt を処理および検証し、Jwt クレームセットを返すために使用されるConverter- 導入:
- 5.2
メソッドの詳細
setJwtValidator
public void setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator)
付属のOAuth2TokenValidatorを使用して、受信Jwtを検証します。- パラメーター:
jwtValidator- 使用するOAuth2TokenValidator
setClaimSetConverter
public void setClaimSetConverter(org.springframework.core.convert.converter.Converter<java.util.Map<java.lang.String,java.lang.Object>,java.util.Map<java.lang.String,java.lang.Object>> claimSetConverter)
JWT のクレームセットを操作するには、次のConverterを使用します- パラメーター:
claimSetConverter- 使用するConverter
decode
public reactor.core.publisher.Mono<Jwt> decode(java.lang.String token) throws JwtException
インターフェースからコピーされた説明:ReactiveJwtDecoderJWT をそのコンパクトなクレーム表現形式からデコードし、Jwtを返します。- 次で指定:
- インターフェース
ReactiveJwtDecoderのdecode - パラメーター:
token- JWT 値- 戻り値:
Jwt- 例外:
JwtException- JWT のデコード中にエラーが発生した場合
withJwkSetUri
public static NimbusReactiveJwtDecoder.JwkSetUriReactiveJwtDecoderBuilder withJwkSetUri(java.lang.String jwkSetUri)
指定された JWK セット uri を使用して、JWT を検証します。- パラメーター:
jwkSetUri- 使用する JWK セット uri- 戻り値:
- さらなる構成のための
NimbusReactiveJwtDecoder.JwkSetUriReactiveJwtDecoderBuilder - 導入:
- 5.2
withPublicKey
public static NimbusReactiveJwtDecoder.PublicKeyReactiveJwtDecoderBuilder withPublicKey(java.security.interfaces.RSAPublicKey key)
指定された公開鍵を使用して JWT を検証します- パラメーター:
key- 使用する公開鍵- 戻り値:
- さらなる構成のための
NimbusReactiveJwtDecoder.PublicKeyReactiveJwtDecoderBuilder - 導入:
- 5.2
withSecretKey
public static NimbusReactiveJwtDecoder.SecretKeyReactiveJwtDecoderBuilder withSecretKey(javax.crypto.SecretKey secretKey)
指定されたSecretKeyを使用して、JSON Web 署名(JWS)の MAC を検証します。- パラメーター:
secretKey- MAC の検証に使用されるSecretKey- 戻り値:
- さらなる構成のための
NimbusReactiveJwtDecoder.SecretKeyReactiveJwtDecoderBuilder - 導入:
- 5.2
withJwkSource
public static NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder withJwkSource(java.util.function.Function<com.nimbusds.jwt.SignedJWT,reactor.core.publisher.Flux<com.nimbusds.jose.jwk.JWK>> source)
指定されたFunctionを使用して JWT を検証します- パラメーター:
source-Function- 戻り値:
- さらなる構成のための
NimbusReactiveJwtDecoder.JwkSourceReactiveJwtDecoderBuilder - 導入:
- 5.2