public class BasicOAuth2Accessor extends Object implements OAuth2Accessor
OAuth2AccessorOAuth2Accessor.Type| Constructor and Description |
|---|
BasicOAuth2Accessor() |
BasicOAuth2Accessor(OAuth2Accessor accessor) |
BasicOAuth2Accessor(String gadgetUri,
String serviceName,
String user,
String scope,
boolean allowModuleOverrides,
OAuth2Store store,
String globalRedirectUri,
Authority authority,
String contextRoot) |
| 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> additionalRequestParams)
set the oauth2 request parameters
|
void |
setAllowedDomains(String[] allowedDomains)
sets the domains of allowed resource servers
|
void |
setAuthorizationHeader(boolean authorizationHeader) |
void |
setAuthorizationUrl(String authorizationUrl)
updates the authorization endpoint url
|
void |
setClientAuthenticationType(String clientAuthenticationType) |
void |
setClientId(String clientId) |
void |
setClientSecret(byte[] clientSecret) |
void |
setErrorResponse(Throwable exception,
OAuth2Error error,
String contextMessage,
String errorUri) |
void |
setErrorUri(String errorUri) |
void |
setGrantType(String grantType) |
void |
setRedirecting(boolean redirecting)
Used to communicate that we are in a redirect authorization flow and the accessor should be
preserved.
|
void |
setRedirectUri(String redirectUri) |
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
|
void |
setType(OAuth2Accessor.Type type) |
void |
setUrlParameter(boolean urlParameter) |
public BasicOAuth2Accessor()
public BasicOAuth2Accessor(OAuth2Accessor accessor)
public OAuth2Token getAccessToken()
getAccessToken in interface OAuth2AccessorOAuth2Token or nullpublic String getAuthorizationUrl()
getAuthorizationUrl in interface OAuth2Accessorpublic String getClientAuthenticationType()
OAuth2AccessorgetClientAuthenticationType in interface OAuth2Accessorpublic String getClientId()
getClientId in interface OAuth2Accessorpublic byte[] getClientSecret()
getClientSecret in interface OAuth2Accessorpublic OAuth2Error getError()
getError in interface OAuth2Accessorpublic String getErrorContextMessage()
getErrorContextMessage in interface OAuth2Accessorpublic Throwable getErrorException()
getErrorException in interface OAuth2Accessornullpublic String getErrorUri()
getErrorUri in interface OAuth2Accessornullpublic String getGadgetUri()
getGadgetUri in interface OAuth2Accessorpublic String getGrantType()
getGrantType in interface OAuth2Accessorpublic String getRedirectUri()
getRedirectUri in interface OAuth2Accessorpublic OAuth2Token getRefreshToken()
getRefreshToken in interface OAuth2AccessorOAuth2Token or nullpublic Map<String,String> getAdditionalRequestParams()
getAdditionalRequestParams in interface OAuth2Accessornull)public String getScope()
OAuth2Accessorhttp://tools.ietf.org/html/draft-ietf-oauth-v2-21#section-3.3getScope in interface OAuth2Accessorpublic String getServiceName()
getServiceName in interface OAuth2Accessorpublic OAuth2CallbackState getState()
getState in interface OAuth2Accessorpublic String getTokenUrl()
getTokenUrl in interface OAuth2Accessorpublic OAuth2Accessor.Type getType()
getType in interface OAuth2AccessorOAuth2Accessor.Type of client for this accessorpublic String getUser()
getUser in interface OAuth2Accessorpublic void invalidate()
OAuth2Accessorinvalidate in interface OAuth2Accessorpublic boolean isAllowModuleOverrides()
isAllowModuleOverrides in interface OAuth2Accessortrue if the gadget's public boolean isAuthorizationHeader()
OAuth2AccessorisAuthorizationHeader in interface OAuth2Accessorpublic boolean isErrorResponse()
isErrorResponse in interface OAuth2Accessorpublic boolean isRedirecting()
OAuth2AccessorisRedirecting in interface OAuth2Accessorpublic boolean isUrlParameter()
OAuth2AccessorisUrlParameter in interface OAuth2Accessorpublic boolean isValid()
isValid in interface OAuth2Accessorpublic void setAccessToken(OAuth2Token accessToken)
OAuth2AccessorOAuth2Store)setAccessToken in interface OAuth2Accessorpublic void setAuthorizationHeader(boolean authorizationHeader)
public void setAuthorizationUrl(String authorizationUrl)
OAuth2AccessorsetAuthorizationUrl in interface OAuth2Accessorpublic void setClientAuthenticationType(String clientAuthenticationType)
public void setClientId(String clientId)
public void setClientSecret(byte[] clientSecret)
public void setErrorResponse(Throwable exception, OAuth2Error error, String contextMessage, String errorUri)
setErrorResponse in interface OAuth2Accessorpublic void setErrorUri(String errorUri)
public void setGrantType(String grantType)
public void setRedirecting(boolean redirecting)
OAuth2AccessorsetRedirecting in interface OAuth2Accessorpublic void setRedirectUri(String redirectUri)
public void setRefreshToken(OAuth2Token refreshToken)
OAuth2AccessorOAuth2Store)setRefreshToken in interface OAuth2Accessorpublic void setAdditionalRequestParams(Map<String,String> additionalRequestParams)
OAuth2AccessorsetAdditionalRequestParams in interface OAuth2Accessorpublic void setTokenUrl(String tokenUrl)
OAuth2AccessorsetTokenUrl in interface OAuth2Accessorpublic void setType(OAuth2Accessor.Type type)
public void setUrlParameter(boolean urlParameter)
public void setAllowedDomains(String[] allowedDomains)
OAuth2AccessorsetAllowedDomains in interface OAuth2Accessorpublic String[] getAllowedDomains()
OAuth2AccessorgetAllowedDomains in interface OAuth2AccessornullCopyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.