Package com.nimbusds.oauth2.sdk
Class TokenIntrospectionSuccessResponse
java.lang.Object
com.nimbusds.oauth2.sdk.TokenIntrospectionResponse
com.nimbusds.oauth2.sdk.TokenIntrospectionSuccessResponse
- All Implemented Interfaces:
Message,Response,SuccessResponse
@Immutable
public class TokenIntrospectionSuccessResponse
extends TokenIntrospectionResponse
implements SuccessResponse
Token introspection success response.
Related specifications:
- OAuth 2.0 Token Introspection (RFC 7662).
- OAuth 2.0 Rich Authorization Requests (RFC 9396), section 9.2.
- OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (RFC 8705).
- OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP) (RFC 9449)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing token introspection success responses. -
Constructor Summary
ConstructorsConstructorDescriptionTokenIntrospectionSuccessResponse(net.minidev.json.JSONObject params) Creates a new token introspection success response. -
Method Summary
Modifier and TypeMethodDescriptionReturns the intended audience for the token.Returns the Rich Authorisation Request (RAR) details.booleangetBooleanParameter(String name) Returns the boolean parameter with the specified name.Returns the identifier of the OAuth 2.0 client that requested the token.Returns the token expiration time.Returns the token issuer.Returns the token issue time.net.minidev.json.JSONArraygetJSONArrayParameter(String name) Returns the JSON array parameter with the specified name.net.minidev.json.JSONObjectgetJSONObjectParameter(String name) Returns the JSON object parameter with the specified name.Returns the JSON Web Key (JWK) SHA-256 thumbprint confirmation, for OAuth 2.0 DPoP.getJWTID()Returns the token identifier.Returns the token not-before time.getNumberParameter(String name) Returns the number parameter with the specified name.net.minidev.json.JSONObjectReturns the underlying parameters.getScope()Returns the scope of the token.getStringListParameter(String name) Returns the string list parameter with the specified name.getStringParameter(String name) Returns the string parameter with the specified name.Returns the subject of the token, usually a machine-readable identifier of the resource owner who authorised the token.Returns the access token type.Returns the username of the resource owner who authorised the token.Returns the client X.509 certificate confirmation, for a mutual TLS client certificate bound access token.com.nimbusds.jose.util.Base64URLDeprecated.booleanChecks if the response indicates success.booleanisActive()Returns the active status for the token.parse(HTTPResponse httpResponse) Parses a token introspection success response from the specified HTTP response.parse(net.minidev.json.JSONObject jsonObject) Parses a token introspection success response from the specified JSON object.Returns the matching HTTP response.net.minidev.json.JSONObjectReturns a JSON object representation of this token introspection success response.Methods inherited from class com.nimbusds.oauth2.sdk.TokenIntrospectionResponse
toErrorResponse, toSuccessResponse
-
Constructor Details
-
TokenIntrospectionSuccessResponse
Creates a new token introspection success response.- Parameters:
params- The response parameters. Must contain at least the requiredactiveparameter and not benull.
-
-
Method Details
-
isActive
Returns the active status for the token. Corresponds to theactiveparameter.- Returns:
trueif the token is active, elsefalse.
-
getScope
Returns the scope of the token. Corresponds to thescopeparameter.- Returns:
- The token scope,
nullif not specified.
-
getClientID
Returns the identifier of the OAuth 2.0 client that requested the token. Corresponds to theclient_idparameter.- Returns:
- The client identifier,
nullif not specified.
-
getUsername
Returns the username of the resource owner who authorised the token. Corresponds to theusernameparameter.- Returns:
- The username,
nullif not specified.
-
getTokenType
Returns the access token type. Corresponds to thetoken_typeparameter.- Returns:
- The token type,
nullif not specified.
-
getExpirationTime
Returns the token expiration time. Corresponds to theexpparameter.- Returns:
- The token expiration time,
nullif not specified.
-
getIssueTime
Returns the token issue time. Corresponds to theiatparameter.- Returns:
- The token issue time,
nullif not specified.
-
getNotBeforeTime
Returns the token not-before time. Corresponds to thenbfparameter.- Returns:
- The token not-before time,
nullif not specified.
-
getSubject
Returns the subject of the token, usually a machine-readable identifier of the resource owner who authorised the token. Corresponds to thesubparameter.- Returns:
- The token subject,
nullif not specified.
-
getAudience
Returns the intended audience for the token. Corresponds to theaudparameter.- Returns:
- The token audience,
nullif not specified.
-
getIssuer
Returns the token issuer. Corresponds to theissparameter.- Returns:
- The token issuer,
nullif not specified.
-
getJWTID
Returns the token identifier. Corresponds to thejtiparameter.- Returns:
- The token identifier,
nullif not specified.
-
getX509CertificateSHA256Thumbprint
Deprecated.Returns the client X.509 certificate SHA-256 thumbprint, for a mutual TLS client certificate bound access token. Corresponds to thecnf.x5t#S256parameter.- Returns:
- The client X.509 certificate SHA-256 thumbprint,
nullif not specified.
-
getX509CertificateConfirmation
Returns the client X.509 certificate confirmation, for a mutual TLS client certificate bound access token. Corresponds to thecnf.x5t#S256parameter.- Returns:
- The client X.509 certificate confirmation,
nullif not specified.
-
getJWKThumbprintConfirmation
Returns the JSON Web Key (JWK) SHA-256 thumbprint confirmation, for OAuth 2.0 DPoP. Corresponds to thecnf.jktparameter.- Returns:
- The JWK SHA-256 thumbprint confirmation,
nullif not specified.
-
getAuthorizationDetails
Returns the Rich Authorisation Request (RAR) details. Corresponds to theauthorization_detailsparameter.- Returns:
- The authorisation details,
nullif not specified.
-
getStringParameter
Returns the string parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value,
nullif not specified or if parsing failed.
-
getBooleanParameter
Returns the boolean parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value.
- Throws:
ParseException- If the parameter isn't specified or parsing failed.
-
getNumberParameter
Returns the number parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value,
nullif not specified or parsing failed.
-
getStringListParameter
Returns the string list parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value,
nullif not specified or if parsing failed.
-
getJSONObjectParameter
Returns the JSON object parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value,
nullif not specified or if parsing failed.
-
getJSONArrayParameter
Returns the JSON array parameter with the specified name.- Parameters:
name- The parameter name. Must not benull.- Returns:
- The parameter value,
nullif not specified or if parsing failed.
-
getParameters
Returns the underlying parameters.- Returns:
- The parameters, as JSON object.
-
toJSONObject
Returns a JSON object representation of this token introspection success response.Example JSON object:
{ "active" : true, "client_id" : "l238j323ds-23ij4", "username" : "jdoe", "scope" : "read write dolphin", "sub" : "Z5O3upPC88QrAjx00dis", "aud" : "https://protected.example.net/resource", "iss" : "https://server.example.com/", "exp" : 1419356238, "iat" : 1419350238, "extension_field" : "twenty-seven" }- Returns:
- The JSON object.
-
indicatesSuccess
Description copied from interface:ResponseChecks if the response indicates success.- Specified by:
indicatesSuccessin interfaceResponse- Returns:
trueif the response indicates success, elsefalse.
-
toHTTPResponse
Description copied from interface:ResponseReturns the matching HTTP response.- Specified by:
toHTTPResponsein interfaceResponse- Returns:
- The HTTP response.
-
parse
public static TokenIntrospectionSuccessResponse parse(net.minidev.json.JSONObject jsonObject) throws ParseException Parses a token introspection success response from the specified JSON object.- Parameters:
jsonObject- The JSON object to parse. Must not benull.- Returns:
- The token introspection success response.
- Throws:
ParseException- If the JSON object couldn't be parsed to a token introspection success response.
-
parse
public static TokenIntrospectionSuccessResponse parse(HTTPResponse httpResponse) throws ParseException Parses a token introspection success response from the specified HTTP response.- Parameters:
httpResponse- The HTTP response. Must not benull.- Returns:
- The token introspection success response.
- Throws:
ParseException- If the HTTP response couldn't be parsed to a token introspection success response.
-