public interface MasterAccessTokenValidator
Modifier and Type | Interface and Description |
---|---|
static class |
MasterAccessTokenValidator.ErrorResponse
Bearer token error response.
|
Modifier and Type | Field and Description |
---|---|
static MasterAccessTokenValidator.ErrorResponse |
INVALID_BEARER_TOKEN
Error response: Invalid OAuth 2.0 Bearer access token.
|
static MasterAccessTokenValidator.ErrorResponse |
MISSING_BEARER_TOKEN
Error response: Missing OAuth 2.0 Bearer access token.
|
static MasterAccessTokenValidator.ErrorResponse |
WEB_API_DISABLED
Error response: Web API disabled.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accessIsDisabled()
Returns
true if access is disabled (no access token
configured). |
static byte[] |
computeSHA256(com.nimbusds.oauth2.sdk.token.BearerAccessToken token,
byte[] salt)
Computes the SHA-256 hash of the specified Bearer access token.
|
org.apache.logging.log4j.Logger |
getLogger()
Gets the optional logger.
|
boolean |
isValid(com.nimbusds.oauth2.sdk.token.BearerAccessToken accessToken)
Returns
true if the specified bearer access token is valid. |
void |
setLogger(org.apache.logging.log4j.Logger log)
Sets the optional logger.
|
boolean |
validateBearerAccessToken(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
Validates a bearer access token passed in the specified HTTP servlet
request.
|
void |
validateBearerAccessToken(String authzHeader)
Validates a bearer access token passed in the specified HTTP
Authorization header value.
|
static final MasterAccessTokenValidator.ErrorResponse MISSING_BEARER_TOKEN
static final MasterAccessTokenValidator.ErrorResponse INVALID_BEARER_TOKEN
static final MasterAccessTokenValidator.ErrorResponse WEB_API_DISABLED
static byte[] computeSHA256(com.nimbusds.oauth2.sdk.token.BearerAccessToken token, byte[] salt)
token
- The Bearer access token. Must not be null
.salt
- Optional salt to use, null
if none.boolean accessIsDisabled()
true
if access is disabled (no access token
configured).true
if access is disabled, else false
.org.apache.logging.log4j.Logger getLogger()
null
if not specified.void setLogger(org.apache.logging.log4j.Logger log)
log
- The logger, null
if not specified.boolean isValid(com.nimbusds.oauth2.sdk.token.BearerAccessToken accessToken)
true
if the specified bearer access token is valid.accessToken
- The bearer access token to check, null
if
not specified.true
if the specified bearer access token is valid,
else false
.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.boolean validateBearerAccessToken(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse) throws IOException
servletRequest
- The HTTP servlet request. Must not be
null
.servletResponse
- The HTTP servlet response. Must not be
null
.true
if the bearer access token was successfully
validated, false
.IOException
- If the response couldn't be written.Copyright © 2020 Connect2id. All rights reserved.