public class BasicAccessTokenValidator extends Object
Modifier and Type | Field and Description |
---|---|
static javax.ws.rs.WebApplicationException |
INVALID_BEARER_TOKEN
Error response: Invalid OAuth 2.0 Bearer access token.
|
static javax.ws.rs.WebApplicationException |
MISSING_BEARER_TOKEN
Error response: Missing OAuth 2.0 Bearer access token.
|
static javax.ws.rs.WebApplicationException |
WEB_API_DISABLED
Error response: Web API disabled.
|
Constructor and Description |
---|
BasicAccessTokenValidator(com.nimbusds.oauth2.sdk.token.BearerAccessToken accessToken)
Creates a new basic access token validator.
|
Modifier and Type | Method and Description |
---|---|
com.nimbusds.oauth2.sdk.token.BearerAccessToken |
getAccessToken()
Returns the Bearer access token.
|
void |
validateBearerAccessToken(String authzHeader)
Validates a Bearer access token passed in the specified HTTP
Authorization header value.
|
public static final javax.ws.rs.WebApplicationException MISSING_BEARER_TOKEN
JSON object:
{ "error" : "missing_token", "error_description" : "Unauthorized: Missing Bearer access token" }
public static final javax.ws.rs.WebApplicationException INVALID_BEARER_TOKEN
JSON object:
{ "error" : "invalid_token", "error_description" : "Unauthorized: Invalid Bearer access token" }
public static final javax.ws.rs.WebApplicationException WEB_API_DISABLED
JSON object:
{ "error" : "web_api_disabled", "error_description" : "Forbidden: Web API disabled" }
public BasicAccessTokenValidator(com.nimbusds.oauth2.sdk.token.BearerAccessToken accessToken)
accessToken
- The Bearer access token. If null
access
to the web API will be disabled.public com.nimbusds.oauth2.sdk.token.BearerAccessToken getAccessToken()
null
access to the web API
is disabled.public void validateBearerAccessToken(String authzHeader) throws javax.ws.rs.WebApplicationException
authzHeader
- The HTTP Authorization header value, null
if not specified.javax.ws.rs.WebApplicationException
- If the header value is null
,
the web API is disabled, or the
Bearer access token is missing or
invalid.Copyright © 2014 Connect2id. All Rights Reserved.