Class PresetClaims
- 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 PresetClaims()
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable net.minidev.json.JSONObject
getPresetIDTokenClaims()
Returns the additional or preset claims to be included in the ID token.@Nullable net.minidev.json.JSONObject
getPresetUserInfoClaims()
Returns the additional or preset claims to be returned in the UserInfo response.boolean
isEmpty()
Returnstrue
if there are no preset claims specified.static PresetClaims
parse(net.minidev.json.JSONObject o)
Parses a preset claims representation from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this preset claims instance.String
toString()
-
-
-
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()
Returnstrue
if there are no preset claims specified.- Returns:
true
if there are no preset claims specified, elsefalse
.
-
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 benull
.- Returns:
- The preset claims.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
-