public interface OAuthTokenHandler
| Modifier and Type | Method and Description |
|---|---|
OAuthToken |
decodeOAuthToken(String rawTokenValue)
Creates an
OAuthToken instance from the incoming token value. |
String |
getAuthzDN(OAuthToken token)
Extracts the DN of the authorization entry (for which to apply access
controls) from the incoming token.
|
boolean |
isTokenAuthentic(OAuthToken token)
Determines whether the incoming token is authentic (i.e.
|
boolean |
isTokenExpired(OAuthToken token)
Determines whether the given token is expired.
|
boolean |
isTokenForThisServer(OAuthToken token)
Determines whether the incoming token is targeted for this server.
|
OAuthTokenStatus |
validateToken(OAuthToken token,
SCIMRequest scimRequest)
Determines whether the incoming token is valid for the given request.
|
OAuthToken decodeOAuthToken(String rawTokenValue) throws GeneralSecurityException
OAuthToken instance from the incoming token value.
Implementers may choose to return a subclass of OAuthToken in
order to provide convenience methods for interacting with the token. This
can be helpful because the returned OAuthToken is passed to all of
the other methods in this class.
rawTokenValue - the b64token token value. Note that b64token is just
an ABNF syntax definition and does not imply any
base64-encoding of the token value.OAuthToken instance. This must not be null.GeneralSecurityException - if there is an error decoding the tokenboolean isTokenExpired(OAuthToken token) throws GeneralSecurityException
token - the OAuth 2.0 bearer token.true if the token is already expired, false if not.GeneralSecurityException - if there is an error determining the
token's expiration dateboolean isTokenAuthentic(OAuthToken token) throws GeneralSecurityException
token - the OAuth 2.0 bearer token.true if the bearer token can be verified as authentic and
originating from a trusted source, false if not.GeneralSecurityException - if there is an error determining whether
the token is authenticboolean isTokenForThisServer(OAuthToken token) throws GeneralSecurityException
token - the OAuth 2.0 bearer token.true if the bearer token identifies this server as the
intended recipient, false if not.GeneralSecurityException - if there is an error determining whether
the token is for this serverOAuthTokenStatus validateToken(OAuthToken token, SCIMRequest scimRequest) throws GeneralSecurityException
SCIMRequest. This typically
involves checking the token scope and any other attributes granted by the
authorization grant. Implementations may need to call back to the
authorization server to verify that the token is still valid and has not
been revoked.token - the OAuth 2.0 bearer token.scimRequest - the SCIMRequest that we are validating.OAuthTokenStatus object which indicates whether the
bearer token is valid and grants access to the target resource.
This must not be null.GeneralSecurityException - if there is an error determining whether
the token is validString getAuthzDN(OAuthToken token) throws GeneralSecurityException
This may require performing an LDAP search in order to find the DN that matches a certain attribute value contained in the token.
token - the OAuth 2.0 bearer token.null.GeneralSecurityException - if there is an error determining the
authorization user DNCopyright © 2011–2016 UnboundID. All rights reserved.