java.lang.Object
com.nimbusds.openid.connect.provider.spi.grants.PresetClaims

@Immutable public final class PresetClaims extends Object
Additional or preset OpenID Connect claims. These may be included in the ID token or in the UserInfo response.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty preset claims instance.
    PresetClaims(@Nullable net.minidev.json.JSONObject idTokenClaims, @Nullable net.minidev.json.JSONObject userInfoClaims)
    Creates a new preset claims instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minidev.json.JSONObject
    Returns the additional or preset claims to be included in the ID token.
    @Nullable net.minidev.json.JSONObject
    Returns the additional or preset claims to be returned in the UserInfo response.
    boolean
    Returns true if there are no preset claims specified.
    parse(net.minidev.json.JSONObject o)
    Parses a preset claims representation from the specified JSON object.
    net.minidev.json.JSONObject
    Returns a JSON object representation of this preset claims instance.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PresetClaims

      public PresetClaims()
      Creates a new empty preset claims instance.
    • PresetClaims

      public PresetClaims(@Nullable net.minidev.json.JSONObject idTokenClaims, @Nullable net.minidev.json.JSONObject userInfoClaims)
      Creates a new preset claims instance.
      Parameters:
      idTokenClaims - Additional or preset claims to be included in the ID token, null if none.
      userInfoClaims - Additional or preset claims to be included in the UserInfo response, null if none.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns true if there are no preset claims specified.
      Returns:
      true if there are no preset claims specified, else false.
    • getPresetIDTokenClaims

      public @Nullable net.minidev.json.JSONObject getPresetIDTokenClaims()
      Returns the additional or preset claims to be included in the ID token.
      Returns:
      The preset ID token claims, null if none.
    • getPresetUserInfoClaims

      public @Nullable net.minidev.json.JSONObject getPresetUserInfoClaims()
      Returns the additional or preset claims to be returned in the UserInfo response.
      Returns:
      The preset UserInfo claims, null if none.
    • toJSONObject

      public net.minidev.json.JSONObject toJSONObject()
      Returns a JSON object representation of this preset claims instance.
      Returns:
      The JSON object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parse

      public static PresetClaims parse(net.minidev.json.JSONObject o) throws com.nimbusds.oauth2.sdk.ParseException
      Parses a preset claims representation from the specified JSON object.
      Parameters:
      o - The JSON object. Must not be null.
      Returns:
      The preset claims.
      Throws:
      com.nimbusds.oauth2.sdk.ParseException - If parsing failed.