クラス MappedJwtClaimSetConverter
java.lang.ObjectSE
org.springframework.security.oauth2.jwt.MappedJwtClaimSetConverter
- 実装されたすべてのインターフェース:
org.springframework.core.convert.converter.Converter<MapSE<StringSE,
ObjectSE>, MapSE<StringSE, ObjectSE>>
public final class MappedJwtClaimSetConverter
extends ObjectSE
implements org.springframework.core.convert.converter.Converter<MapSE<StringSE,ObjectSE>,MapSE<StringSE,ObjectSE>>
JWT クレームセットをクレームごとに変換します。クレーム名によってカスタムコンバーターで構成できます。
- 導入:
- 5.1
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明MappedJwtClaimSetConverter
(MapSE<StringSE, org.springframework.core.convert.converter.Converter<ObjectSE, ?>> claimTypeConverters) 指定された引数を使用してMappedJwtClaimSetConverter
を構築します。これにより、デフォルトコンバーターのセットが完全に置き換えられます。メソッドのサマリー
修飾子と型メソッド説明static MappedJwtClaimSetConverter
withDefaults
(MapSE<StringSE, org.springframework.core.convert.converter.Converter<ObjectSE, ?>> claimTypeConverters) クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.core.convert.converter.Converter から継承されたメソッド
andThen
コンストラクターの詳細
MappedJwtClaimSetConverter
public MappedJwtClaimSetConverter(MapSE<StringSE, org.springframework.core.convert.converter.Converter<ObjectSE, ?>> claimTypeConverters) 提供された引数を使用してMappedJwtClaimSetConverter
を構築します。これにより、デフォルトのコンバーターのセットが完全に置き換えられます。null
を返すコンバーターは、クレームセットからクレームを削除します。null
以外の値を返すコンバーターは、クレームセット内のそのクレームを追加または置換します。- パラメーター:
claimTypeConverters
- 使用するコンバーターのMap
SE
メソッドの詳細
withDefaults
public static MappedJwtClaimSetConverter withDefaults(MapSE<StringSE, org.springframework.core.convert.converter.Converter<ObjectSE, ?>> claimTypeConverters) MappedJwtClaimSetConverter
を構築し、個々のクレームコンバーターをConverter
の提供されたMap
SE でオーバーライドします。例: 次の例では、既定のクレームコンバーターのみで構成されたインスタンスが生成されます。MappedJwtClaimSetConverter.withDefaults(Collections.emptyMap());
または、次の例では、サブジェクトのカスタムコンバーターを提供し、他のデフォルトはそのままにします。MappedJwtClaimsSetConverter.withDefaults( Collections.singletonMap(JwtClaimNames.SUB, new UserDetailsServiceJwtSubjectConverter()));
基礎となるコンバーターのMap
SE を完全に置き換えるには、MappedJwtClaimSetConverter(Map)
を参照してください。null
を返すコンバーターは、クレームセットからクレームを削除します。null
以外の値を返すコンバーターは、クレームセット内のそのクレームを追加または置換します。- パラメーター:
claimTypeConverters
-- 戻り値:
- 提供されたコンバーターと、オーバーライドされなかったデフォルトを含む
MappedJwtClaimSetConverter
のインスタンス。
convert