@Immutable public final class TokenRevocationRequest extends AbstractRequest
Example token revocation request with client authentication:
POST /revoke HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW token=45ghiukldjahdnhzdauz&token_type_hint=refresh_token
Related specifications:
Constructor and Description |
---|
TokenRevocationRequest(java.net.URI uri,
ClientAuthentication clientAuth,
Token token) |
Modifier and Type | Method and Description |
---|---|
ClientAuthentication |
getClientAuthentication()
Gets the client authentication.
|
Token |
getToken()
Returns the token to revoke.
|
static TokenRevocationRequest |
parse(HTTPRequest httpRequest)
Parses a token revocation request from the specified HTTP request.
|
HTTPRequest |
toHTTPRequest()
Returns the matching HTTP request.
|
getEndpointURI
public TokenRevocationRequest(java.net.URI uri, ClientAuthentication clientAuth, Token token)
uri
- The URI of the token revocation 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 revoke. Must not be
null
.public ClientAuthentication getClientAuthentication()
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 be provided as part of the token
revocation request.public HTTPRequest toHTTPRequest() throws SerializeException
Request
SerializeException
- If the request message couldn't be
serialised to an HTTP request.public static TokenRevocationRequest 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 revocation request.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.