Class DeviceSecretToken
java.lang.Object
com.nimbusds.oauth2.sdk.id.Identifier
com.nimbusds.oauth2.sdk.token.Token
com.nimbusds.openid.connect.sdk.nativesso.DeviceSecretToken
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
Token
representation of a device secret.
Related specifications:
- OpenID Connect Native SSO for Mobile Apps 1.0
- See Also:
-
Field Summary
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
Constructor Summary
ConstructorsConstructorDescriptionDeviceSecretToken
(DeviceSecret deviceSecret) Creates a new device secret token. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the device secret.Returns the token parameter names included in the JSON object, as required for the composition of an access token response.static DeviceSecretToken
parse
(net.minidev.json.JSONObject jsonObject) Parses a device secret token from a JSON object access token response.net.minidev.json.JSONObject
Returns the token parameters as a JSON object, as required for the composition of an access token response.Methods inherited from class com.nimbusds.oauth2.sdk.token.Token
getCustomParameters
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
Constructor Details
-
DeviceSecretToken
Creates a new device secret token.- Parameters:
deviceSecret
- The device secret. Must not benull
.
-
-
Method Details
-
getDeviceSecret
Returns the device secret.- Returns:
- The device secret.
-
getParameterNames
Description copied from class:Token
Returns the token parameter names included in the JSON object, as required for the composition of an access token response. See OAuth 2.0 (RFC 6749), section 5.1.- Specified by:
getParameterNames
in classToken
- Returns:
- The token parameter names.
-
toJSONObject
Description copied from class:Token
Returns the token parameters as a JSON object, as required for the composition of an access token response. See OAuth 2.0 (RFC 6749), section 5.1.Note that JSONObject implements Map<String,Object>.
Example:
{ "access_token" : "2YotnFZFEjr1zCsicMWpAA", "token_type" : "example", "expires_in" : 3600, "example_parameter" : "example_value" }
- Specified by:
toJSONObject
in classToken
- Returns:
- The token parameters as a JSON object.
-
parse
Parses a device secret token from a JSON object access token response.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The device secret token,
null
if not found. - Throws:
ParseException
- If the JSON object couldn't be parsed to a device secret token.
-
equals
- Overrides:
equals
in classIdentifier
-