@Immutable public class TokenIntrospectionRequest extends AbstractOptionallyAuthenticatedRequest
The protected resource may be required to authenticate itself to the
token introspection endpoint with a standard client
authentication method
, such as
client_secret_basic
,
or with a dedicated access token
.
Example token introspection request, where the protected resource authenticates itself with a secret (the token type is also hinted):
POST /introspect HTTP/1.1 Host: server.example.com Accept: application/json Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW token=mF_9.B5f-4.1JqM&token_type_hint=access_token
Example token introspection request, where the protected resource authenticates itself with a bearer token:
POST /introspect HTTP/1.1 Host: server.example.com Accept: application/json Content-Type: application/x-www-form-urlencoded Authorization: Bearer 23410913-abewfq.123483 token=2YotnFZFEjr1zCsicMWpAA
Related specifications:
Constructor and Description |
---|
TokenIntrospectionRequest(java.net.URI uri,
AccessToken clientAuthz,
Token token)
Creates a new token introspection request.
|
TokenIntrospectionRequest(java.net.URI uri,
AccessToken clientAuthz,
Token token,
java.util.Map<java.lang.String,java.lang.String> customParams)
Creates a new token introspection request.
|
TokenIntrospectionRequest(java.net.URI uri,
ClientAuthentication clientAuth,
Token token)
Creates a new token introspection request.
|
TokenIntrospectionRequest(java.net.URI uri,
ClientAuthentication clientAuth,
Token token,
java.util.Map<java.lang.String,java.lang.String> customParams)
Creates a new token introspection request.
|
TokenIntrospectionRequest(java.net.URI uri,
Token token)
Creates a new token introspection request.
|
TokenIntrospectionRequest(java.net.URI uri,
Token token,
java.util.Map<java.lang.String,java.lang.String> customParams)
Creates a new token introspection request.
|
Modifier and Type | Method and Description |
---|---|
AccessToken |
getClientAuthorization()
Returns the client authorisation.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomParameters()
Returns the custom request parameters.
|
Token |
getToken()
Returns the token to introspect.
|
static TokenIntrospectionRequest |
parse(HTTPRequest httpRequest)
Parses a token introspection request from the specified HTTP
request.
|
HTTPRequest |
toHTTPRequest()
Returns the matching HTTP request.
|
getClientAuthentication
getEndpointURI
public TokenIntrospectionRequest(java.net.URI uri, Token token)
uri
- The URI of the token introspection endpoint. May be
null
if the toHTTPRequest()
method will
not be used.token
- The access or refresh token to introspect. Must not be
null
.public TokenIntrospectionRequest(java.net.URI uri, Token token, java.util.Map<java.lang.String,java.lang.String> customParams)
uri
- The URI of the token introspection endpoint. May
be null
if the toHTTPRequest()
method will not be used.token
- The access or refresh token to introspect. Must
not be null
.customParams
- Optional custom parameters, null
if
none.public TokenIntrospectionRequest(java.net.URI uri, ClientAuthentication clientAuth, Token token)
uri
- The URI of the token introspection endpoint. May
be null
if the toHTTPRequest()
method will not be used.clientAuth
- The client authentication, null
if none.token
- The access or refresh token to introspect. Must
not be null
.public TokenIntrospectionRequest(java.net.URI uri, ClientAuthentication clientAuth, Token token, java.util.Map<java.lang.String,java.lang.String> customParams)
uri
- The URI of the token introspection endpoint. May
be null
if the toHTTPRequest()
method will not be used.clientAuth
- The client authentication, null
if none.token
- The access or refresh token to introspect. Must
not be null
.customParams
- Optional custom parameters, null
if
none.public TokenIntrospectionRequest(java.net.URI uri, AccessToken clientAuthz, Token token)
uri
- The URI of the token introspection endpoint. May
be null
if the toHTTPRequest()
method will not be used.clientAuthz
- The client authorisation, null
if none.token
- The access or refresh token to introspect. Must
not be null
.public TokenIntrospectionRequest(java.net.URI uri, AccessToken clientAuthz, Token token, java.util.Map<java.lang.String,java.lang.String> customParams)
uri
- The URI of the token introspection endpoint. May
be null
if the toHTTPRequest()
method will not be used.clientAuthz
- The client authorisation, null
if none.token
- The access or refresh token to introspect. Must
not be null
.customParams
- Optional custom parameters, null
if
none.public AccessToken getClientAuthorization()
null
if
none.public Token getToken()
instanceof
operator can
be used to infer the token type. If it's neither
AccessToken
nor
RefreshToken
the
token_type_hint
has not been provided as part of the token
revocation request.public java.util.Map<java.lang.String,java.lang.String> getCustomParameters()
public HTTPRequest toHTTPRequest()
Request
public static TokenIntrospectionRequest parse(HTTPRequest httpRequest) throws ParseException
httpRequest
- The HTTP request. Must not be null
.ParseException
- If the HTTP request couldn't be parsed to a
token introspection request.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.