public class OAuth2TestTokenImpl extends Object implements OAuth2Token
OAuth2Token
implementation This implementation of Oauth2Token is be used by connector tests to perform
oauth2 authenticationConstructor 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 OAuth2Token
public String getAccessTokenType()
refreshToken()
if the Access Token hasn't been
requested yetgetAccessTokenType
in interface OAuth2Token
public String createAccessTokenRequestHeaderValue(HttpURLConnection httpURLConnection) throws IOException
OAuth2Token
createAccessTokenRequestHeaderValue
in interface OAuth2Token
httpURLConnection
- HttpURLConnection (not used for bearer tokens. required for mac tokensIOException
public OAuth2Context getOAuth2Context()
OAuth2Token
getOAuth2Context
in interface OAuth2Token
public String getProperty(String key)
refreshToken()
if the Access Token hasn't been
requested yetgetProperty
in interface OAuth2Token
key
- the property you would like to retrievepublic void refreshToken()