Class ClaimsSpec
- java.lang.Object
-
- com.nimbusds.openid.connect.provider.spi.grants.BasicClaimsSpec
-
- com.nimbusds.openid.connect.provider.spi.grants.ClaimsSpec
-
@Immutable public class ClaimsSpec extends BasicClaimsSpec
OpenID claims specification.
-
-
Field Summary
Fields Modifier and Type Field Description static ClaimsSpec
NONE
None (empty) claims specification.
-
Constructor Summary
Constructors Constructor Description ClaimsSpec()
Creates a new default OpenID claims specification (empty).ClaimsSpec(@Nullable Set<String> names)
Creates a new OpenID claims specification.ClaimsSpec(@Nullable Set<String> names, @Nullable List<com.nimbusds.langtag.LangTag> locales, @Nullable net.minidev.json.JSONObject data, @Nullable net.minidev.json.JSONObject presetIDTokenClaims, @Nullable net.minidev.json.JSONObject presetUserInfoClaims, com.nimbusds.openid.connect.sdk.claims.ClaimsTransport transport)
Creates a new OpenID claims specification.ClaimsSpec(@Nullable Set<String> names, @Nullable List<com.nimbusds.langtag.LangTag> locales, @Nullable net.minidev.json.JSONObject presetIDTokenClaims, @Nullable net.minidev.json.JSONObject presetUserInfoClaims, com.nimbusds.openid.connect.sdk.claims.ClaimsTransport transport)
Creates a new OpenID claims specification.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable List<com.nimbusds.langtag.LangTag>
getLocales()
Returns the preferred OpenID claims locales.com.nimbusds.openid.connect.sdk.claims.ClaimsTransport
getTransport()
Returns the preferred claims transport.static ClaimsSpec
parse(net.minidev.json.JSONObject o)
Parses an OpenID claims specification from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this claims specification.-
Methods inherited from class com.nimbusds.openid.connect.provider.spi.grants.BasicClaimsSpec
getData, getNames, getPresetClaims, getPresetIDTokenClaims, getPresetUserInfoClaims
-
-
-
-
Field Detail
-
NONE
public static final ClaimsSpec NONE
None (empty) claims specification.
-
-
Constructor Detail
-
ClaimsSpec
public ClaimsSpec()
Creates a new default OpenID claims specification (empty).
-
ClaimsSpec
public ClaimsSpec(@Nullable Set<String> names)
Creates a new OpenID claims specification.- Parameters:
names
- The names of the authorised OpenID claims,null
if none.
-
ClaimsSpec
public ClaimsSpec(@Nullable Set<String> names, @Nullable List<com.nimbusds.langtag.LangTag> locales, @Nullable net.minidev.json.JSONObject presetIDTokenClaims, @Nullable net.minidev.json.JSONObject presetUserInfoClaims, com.nimbusds.openid.connect.sdk.claims.ClaimsTransport transport)
Creates a new OpenID claims specification.- Parameters:
names
- The names of the authorised OpenID claims,null
if none. The preferred claims locales,null
if not specified.presetIDTokenClaims
- Additional or preset claims to be included in the ID token,null
if none.presetUserInfoClaims
- Additional or preset claims to be included in the UserInfo response,null
if none.transport
- The preferred claims transport. Must not benull
.
-
ClaimsSpec
public ClaimsSpec(@Nullable Set<String> names, @Nullable List<com.nimbusds.langtag.LangTag> locales, @Nullable net.minidev.json.JSONObject data, @Nullable net.minidev.json.JSONObject presetIDTokenClaims, @Nullable net.minidev.json.JSONObject presetUserInfoClaims, com.nimbusds.openid.connect.sdk.claims.ClaimsTransport transport)
Creates a new OpenID claims specification.- Parameters:
names
- The names of the authorised OpenID claims,null
if none.locales
- The preferred claims locales,data
- Optional claims fulfillment data,null
if not specified.presetIDTokenClaims
- Additional or preset claims to be included in the ID token,null
if none.presetUserInfoClaims
- Additional or preset claims to be included in the UserInfo response,null
if none.transport
- The preferred claims transport. Must not benull
.
-
-
Method Detail
-
getLocales
public @Nullable List<com.nimbusds.langtag.LangTag> getLocales()
Returns the preferred OpenID claims locales.- Returns:
- The preferred OpenID claims locales,
null
if not specified.
-
getTransport
public com.nimbusds.openid.connect.sdk.claims.ClaimsTransport getTransport()
Returns the preferred claims transport.- Returns:
- The preferred claims transport.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns a JSON object representation of this claims specification.- Overrides:
toJSONObject
in classBasicClaimsSpec
- Returns:
- The JSON object.
-
parse
public static ClaimsSpec parse(net.minidev.json.JSONObject o) throws com.nimbusds.oauth2.sdk.ParseException
Parses an OpenID claims specification from the specified JSON object.- Parameters:
o
- The JSON object. Must not benull
.- Returns:
- The OpenID claims specification.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-
-