Class 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 Detail

      • 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 Detail

      • 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.
      • 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.