public interface OAuth2Accessor extends Serializable
OAuth2Request will create an accessor and store it in the OAuth2Store while the
request is being issued. It will be removed when the request is done (success or failure.)
OAuth2Accessor implementations should be Serializable to facilitate cluster storage and
caching across the various phases of OAuth 2.0 flows.| Modifier and Type | Interface and Description |
|---|---|
static class |
OAuth2Accessor.Type
Enumeration of possible accessor types
|
| Modifier and Type | Method and Description |
|---|---|
OAuth2Token |
getAccessToken() |
Map<String,String> |
getAdditionalRequestParams() |
String[] |
getAllowedDomains()
gets the domains of allowed resource servers
|
String |
getAuthorizationUrl() |
String |
getClientAuthenticationType()
|
String |
getClientId() |
byte[] |
getClientSecret() |
OAuth2Error |
getError() |
String |
getErrorContextMessage() |
Throwable |
getErrorException() |
String |
getErrorUri() |
String |
getGadgetUri() |
String |
getGrantType() |
String |
getRedirectUri() |
OAuth2Token |
getRefreshToken() |
String |
getScope()
if the gadget request or gadget spec specifies a scope it will be set here
See
http://tools.ietf.org/html/draft-ietf-oauth-v2-21#section-3.3 |
String |
getServiceName() |
OAuth2CallbackState |
getState() |
String |
getTokenUrl() |
OAuth2Accessor.Type |
getType() |
String |
getUser() |
void |
invalidate()
invalidates the accessor once the request is done.
|
boolean |
isAllowModuleOverrides() |
boolean |
isAuthorizationHeader()
Indicates the service provider wants the access token in an "Authorization:" header, per the
spec.
|
boolean |
isErrorResponse() |
boolean |
isRedirecting()
is this accessor in the middle of a authorize redirect?
|
boolean |
isUrlParameter()
Indicates the service provider wants the access token in an URL Parameter.
|
boolean |
isValid() |
void |
setAccessToken(OAuth2Token accessToken)
updates the access token for the request (does not add it to
OAuth2Store) |
void |
setAdditionalRequestParams(Map<String,String> requestParams)
set the oauth2 request parameters
|
void |
setAllowedDomains(String[] allowedDomains)
sets the domains of allowed resource servers
|
void |
setAuthorizationUrl(String authorizationUrl)
updates the authorization endpoint url
|
void |
setErrorResponse(Throwable exception,
OAuth2Error error,
String contextMessage,
String errorUri) |
void |
setRedirecting(boolean redirecting)
Used to communicate that we are in a redirect authorization flow and the accessor should be
preserved.
|
void |
setRefreshToken(OAuth2Token refreshToken)
updates the refresh token for the request (does not add it to
OAuth2Store) |
void |
setTokenUrl(String tokenUrl)
updates the token endpoint url
|
OAuth2Token getAccessToken()
OAuth2Token or nullString getAuthorizationUrl()
String getClientAuthenticationType()
String getClientId()
byte[] getClientSecret()
OAuth2Error getError()
String getErrorContextMessage()
Throwable getErrorException()
nullString getErrorUri()
nullString getGadgetUri()
String getGrantType()
String getRedirectUri()
OAuth2Token getRefreshToken()
OAuth2Token or nullMap<String,String> getAdditionalRequestParams()
null)String getScope()
http://tools.ietf.org/html/draft-ietf-oauth-v2-21#section-3.3String getServiceName()
OAuth2CallbackState getState()
String getTokenUrl()
OAuth2Accessor.Type getType()
OAuth2Accessor.Type of client for this accessorString getUser()
void invalidate()
boolean isAllowModuleOverrides()
true if the gadget's boolean isAuthorizationHeader()
boolean isErrorResponse()
boolean isRedirecting()
boolean isUrlParameter()
boolean isValid()
void setAccessToken(OAuth2Token accessToken)
OAuth2Store)accessToken - void setAuthorizationUrl(String authorizationUrl)
authorizationUrl - void setErrorResponse(Throwable exception, OAuth2Error error, String contextMessage, String errorUri)
exception - error - contextMessage - errorUri - void setRedirecting(boolean redirecting)
redirecting - void setRefreshToken(OAuth2Token refreshToken)
OAuth2Store)accessToken - void setAdditionalRequestParams(Map<String,String> requestParams)
requestParams - void setTokenUrl(String tokenUrl)
tokenUrl - void setAllowedDomains(String[] allowedDomains)
allowedDomains - String[] getAllowedDomains()
nullCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.