@Immutable
public class CustomTokenIntrospectionSuccessResponse
extends com.nimbusds.oauth2.sdk.TokenIntrospectionResponse
implements com.nimbusds.oauth2.sdk.SuccessResponse
token探寻响应
在CustomOpaqueTokenIntrospector
中被配置CustomOpaqueTokenIntrospector
Modifier and Type | Class and Description |
---|---|
static class |
CustomTokenIntrospectionSuccessResponse.Builder
Builder for constructing token introspection success responses.
|
Constructor and Description |
---|
CustomTokenIntrospectionSuccessResponse(net.minidev.json.JSONObject params)
Creates a new token introspection success response.
|
Modifier and Type | Method and Description |
---|---|
List<com.nimbusds.oauth2.sdk.id.Audience> |
getAudience()
Returns the intended audience for the token.
|
com.nimbusds.oauth2.sdk.Scope |
getAuthorities() |
boolean |
getBooleanParameter(String name)
Returns the boolean parameter with the specified name.
|
com.nimbusds.oauth2.sdk.id.ClientID |
getClientID()
Returns the identifier of the OAuth 2.0 client that requested the token.
|
Date |
getExpirationTime()
Returns the token expiration time.
|
com.nimbusds.oauth2.sdk.id.Issuer |
getIssuer()
Returns the token issuer.
|
Date |
getIssueTime()
Returns the token issue time.
|
net.minidev.json.JSONObject |
getJSONObjectParameter(String name)
Returns the JSON object parameter with the specified name.
|
com.nimbusds.oauth2.sdk.id.JWTID |
getJWTID()
Returns the token identifier.
|
Date |
getNotBeforeTime()
Returns the token not-before time.
|
Number |
getNumberParameter(String name)
Returns the number parameter with the specified name.
|
net.minidev.json.JSONObject |
getParameters()
Returns the underlying parameters.
|
com.nimbusds.oauth2.sdk.Scope |
getScope()
Returns the scope of the token.
|
List<String> |
getStringListParameter(String name)
Returns the string list parameter with the specified name.
|
String |
getStringParameter(String name)
Returns the string parameter with the specified name.
|
com.nimbusds.oauth2.sdk.id.Subject |
getSubject()
Returns the subject of the token, usually a machine-readable identifier of
the resource owner who authorised the token.
|
com.nimbusds.oauth2.sdk.token.AccessTokenType |
getTokenType()
Returns the access token type.
|
String |
getUsername()
Returns the username of the resource owner who authorised the token.
|
com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation |
getX509CertificateConfirmation()
Returns the client X.509 certificate confirmation, for a mutual TLS client
certificate bound access token.
|
com.nimbusds.jose.util.Base64URL |
getX509CertificateSHA256Thumbprint()
Deprecated.
|
boolean |
indicatesSuccess() |
boolean |
isActive()
Returns the active status for the token.
|
static CustomTokenIntrospectionSuccessResponse |
parse(com.nimbusds.oauth2.sdk.http.HTTPResponse httpResponse)
Parses an token introspection success response from the specified HTTP
response.
|
static CustomTokenIntrospectionSuccessResponse |
parse(net.minidev.json.JSONObject jsonObject)
Parses a token introspection success response from the specified JSON object.
|
com.nimbusds.oauth2.sdk.http.HTTPResponse |
toHTTPResponse() |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token introspection success
response.
|
public CustomTokenIntrospectionSuccessResponse(net.minidev.json.JSONObject params)
params
- The response parameters. Must contain at least the required
active
parameter and not be null
.public boolean isActive()
active
claim.true
if the token is active, else false
.public com.nimbusds.oauth2.sdk.Scope getScope()
scope
claim.null
if not specified.public com.nimbusds.oauth2.sdk.Scope getAuthorities()
public com.nimbusds.oauth2.sdk.id.ClientID getClientID()
client_id
claim.null
if not specified.public String getUsername()
username
claim.null
if not specified.public com.nimbusds.oauth2.sdk.token.AccessTokenType getTokenType()
token_type
claim.null
if not specified.public Date getExpirationTime()
exp
claim.null
if not specified.public Date getIssueTime()
iat
claim.null
if not specified.public Date getNotBeforeTime()
nbf
claim.null
if not specified.public com.nimbusds.oauth2.sdk.id.Subject getSubject()
sub
claim.null
if not specified.public List<com.nimbusds.oauth2.sdk.id.Audience> getAudience()
aud
claim.null
if not specified.public com.nimbusds.oauth2.sdk.id.Issuer getIssuer()
iss
claim.null
if not specified.public com.nimbusds.oauth2.sdk.id.JWTID getJWTID()
jti
claim.null
if not specified.@Deprecated public com.nimbusds.jose.util.Base64URL getX509CertificateSHA256Thumbprint()
cnf.x5t#S256
claim.null
if not
specified.public com.nimbusds.oauth2.sdk.auth.X509CertificateConfirmation getX509CertificateConfirmation()
cnf.x5t#S256
claim.null
if not
specified.public String getStringParameter(String name)
name
- The parameter name. Must not be null
.null
if not specified or if parsing
failed.public boolean getBooleanParameter(String name) throws com.nimbusds.oauth2.sdk.ParseException
name
- The parameter name. Must not be null
.com.nimbusds.oauth2.sdk.ParseException
- If the parameter isn't specified or parsing failed.public Number getNumberParameter(String name)
name
- The parameter name. Must not be null
.null
if not specified or parsing failed.public List<String> getStringListParameter(String name)
name
- The parameter name. Must not be null
.null
if not specified or if parsing
failed.public net.minidev.json.JSONObject getJSONObjectParameter(String name)
name
- The parameter name. Must not be null
.null
if not specified or if parsing
failed.public net.minidev.json.JSONObject getParameters()
public net.minidev.json.JSONObject toJSONObject()
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" }
public boolean indicatesSuccess()
indicatesSuccess
in interface com.nimbusds.oauth2.sdk.Response
public com.nimbusds.oauth2.sdk.http.HTTPResponse toHTTPResponse()
toHTTPResponse
in interface com.nimbusds.oauth2.sdk.Response
public static CustomTokenIntrospectionSuccessResponse parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
jsonObject
- The JSON object to parse. Must not be null
.com.nimbusds.oauth2.sdk.ParseException
- If the JSON object couldn't be parsed to a token
introspection success response.public static CustomTokenIntrospectionSuccessResponse parse(com.nimbusds.oauth2.sdk.http.HTTPResponse httpResponse) throws com.nimbusds.oauth2.sdk.ParseException
httpResponse
- The HTTP response. Must not be null
.com.nimbusds.oauth2.sdk.ParseException
- If the HTTP response couldn't be parsed to a token
introspection success response.Copyright © 2021. All rights reserved.