クラス 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

      public MappedJwtClaimSetConverter(MapSE<StringSE,org.springframework.core.convert.converter.Converter<ObjectSE,?>> claimTypeConverters)
      提供された引数を使用して MappedJwtClaimSetConverter を構築します。これにより、デフォルトのコンバーターのセットが完全に置き換えられます。null を返すコンバーターは、クレームセットからクレームを削除します。null 以外の値を返すコンバーターは、クレームセット内のそのクレームを追加または置換します。
      パラメーター:
      claimTypeConverters - 使用するコンバーターの MapSE
  • メソッドの詳細

    • withDefaults

      public static MappedJwtClaimSetConverter withDefaults(MapSE<StringSE,org.springframework.core.convert.converter.Converter<ObjectSE,?>> claimTypeConverters)
      MappedJwtClaimSetConverter を構築し、個々のクレームコンバーターを Converter の提供された MapSE でオーバーライドします。例: 次の例では、既定のクレームコンバーターのみで構成されたインスタンスが生成されます。
              MappedJwtClaimSetConverter.withDefaults(Collections.emptyMap());
       
      または、次の例では、サブジェクトのカスタムコンバーターを提供し、他のデフォルトはそのままにします。
              MappedJwtClaimsSetConverter.withDefaults(
                      Collections.singletonMap(JwtClaimNames.SUB, new UserDetailsServiceJwtSubjectConverter()));
       
      基礎となるコンバーターの MapSE を完全に置き換えるには、MappedJwtClaimSetConverter(Map) を参照してください。null を返すコンバーターは、クレームセットからクレームを削除します。null 以外の値を返すコンバーターは、クレームセット内のそのクレームを追加または置換します。
      パラメーター:
      claimTypeConverters -
      戻り値:
      提供されたコンバーターと、オーバーライドされなかったデフォルトを含む MappedJwtClaimSetConverter のインスタンス。
    • convert

      public MapSE<StringSE,ObjectSE> convert(MapSE<StringSE,ObjectSE> claims)
      次で指定:
      インターフェース org.springframework.core.convert.converter.Converter<MapSE<StringSE,ObjectSE>,MapSE<StringSE,ObjectSE>>convert