public class AccessTokenValidator extends Object
| Constructor and Description |
|---|
AccessTokenValidator(com.authlete.common.api.AuthleteApi api)
Constructor with an implementation of
AuthleteApi interface. |
| Modifier and Type | Method and Description |
|---|---|
protected com.authlete.jaxrs.AuthleteApiCaller |
getApiCaller() |
protected javax.ws.rs.InternalServerErrorException |
unexpected(String message,
Throwable cause) |
AccessTokenInfo |
validate(String accessToken)
Validate an access token.
|
AccessTokenInfo |
validate(String accessToken,
String[] requiredScopes)
Validate an access token.
|
AccessTokenInfo |
validate(String accessToken,
String[] requiredScopes,
String requiredSubject)
Validate an access token.
|
public AccessTokenValidator(com.authlete.common.api.AuthleteApi api)
AuthleteApi interface.api - Implementation of AuthleteApi interface.public AccessTokenInfo validate(String accessToken) throws javax.ws.rs.WebApplicationException
validate(accessToken, null, null).
When the given access token is not valid, this method throws a
WebApplicationException. The response contained in the
exception complies with the requirements described in RFC 6750 (The OAuth
2.0 Authorization Framework: Bearer Token Usage).
accessToken - An access token to validate.javax.ws.rs.WebApplicationException - The access token is invalid. To be concrete, the access
token does not exist or it has expired.public AccessTokenInfo validate(String accessToken, String[] requiredScopes) throws javax.ws.rs.WebApplicationException
validate(accessToken, requiredScopes, null).
When the given access token is not valid, this method throws a
WebApplicationException. The response contained in the
exception complies with the requirements described in RFC 6750 (The OAuth
2.0 Authorization Framework: Bearer Token Usage).
accessToken - An access token to validate.requiredScopes - Scopes that must be associated with the access token.
null is okay.javax.ws.rs.WebApplicationException - The access token is invalid. To be concrete, one or more of
the following conditions meet.
public AccessTokenInfo validate(String accessToken, String[] requiredScopes, String requiredSubject) throws javax.ws.rs.WebApplicationException
WebApplicationException. The response contained in the
exception complies with the requirements described in RFC 6750 (The OAuth
2.0 Authorization Framework: Bearer Token Usage).
accessToken - An access token to validate.requiredScopes - Scopes that must be associated with the access token.
null is okay.requiredSubject - Subject (= user's unique identifier) that must be associated
with the access token. null is okay.javax.ws.rs.WebApplicationException - The access token is invalid. To be concrete, one or more of
the following conditions meet.
protected com.authlete.jaxrs.AuthleteApiCaller getApiCaller()
Copyright © 2016. All rights reserved.