public class OAuth2TestTokenImpl extends Object implements OAuth2Token
OAuth2Token implementation This implementation of Oauth2Token is be used by connector tests to perform
oauth2 authentication| Constructor and Description |
|---|
OAuth2TestTokenImpl(OAuth2TestContextImpl context)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
String |
createAccessTokenRequestHeaderValue(HttpURLConnection httpURLConnection)
Gets the formatted HTTP Authorization Header value for the OAuth 2.0 Access Token.
|
String |
getAccessToken()
Get the OAuth 2.0 access token string
|
String |
getAccessTokenType()
Get the OAuth 2.0 Access Token type.
|
OAuth2Context |
getOAuth2Context()
Convenience method to get the OAuth2Context from the OAuth2Token
|
String |
getProperty(String key)
Get a property from the OAuth 2.0 Access Token response
|
void |
refreshToken()
Refreshes the access token in case of force update This is a POST request for a new access token using the
refresh token.
|
public OAuth2TestTokenImpl(OAuth2TestContextImpl context)
context - the OAuth2TestContextImpl for OAuth authenticationpublic String getAccessToken()
refreshToken() if the Access Token hasn't been
requested yetgetAccessToken in interface OAuth2Tokenpublic String getAccessTokenType()
refreshToken() if the Access Token hasn't been
requested yetgetAccessTokenType in interface OAuth2Tokenpublic String createAccessTokenRequestHeaderValue(HttpURLConnection httpURLConnection) throws IOException
OAuth2TokencreateAccessTokenRequestHeaderValue in interface OAuth2TokenhttpURLConnection - HttpURLConnection (not used for bearer tokens. required for mac tokensIOExceptionpublic OAuth2Context getOAuth2Context()
OAuth2TokengetOAuth2Context in interface OAuth2Tokenpublic String getProperty(String key)
refreshToken() if the Access Token hasn't been
requested yetgetProperty in interface OAuth2Tokenkey - the property you would like to retrievepublic void refreshToken()