public class OAuth2Credentials extends ProviderCredentials
Instead of the typical user access and client keys stored within a ProviderCredentials
class, this class stores an OAuth2 Client ID (as the access key) and Client Secret (as the
secret key).
accessKey, CREDENTIALS_STORAGE_VERSION, friendlyName, log, secretKey, V2_KEYS_DELIMITER, V3_KEYS_DELIMITER
Constructor and Description |
---|
OAuth2Credentials(OAuthUtils oauth,
java.lang.String friendlyName) |
OAuth2Credentials(OAuthUtils oauth,
java.lang.String friendlyName,
java.lang.String refreshToken) |
OAuth2Credentials(java.lang.String clientId,
java.lang.String clientSecret)
Construct credentials.
|
OAuth2Credentials(java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String friendlyName)
Construct credentials, and associate them with a human-friendly name.
|
OAuth2Credentials(java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String friendlyName,
java.lang.String refreshToken)
Construct credentials, and associate them with a human-friendly name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateBrowserUrlToAuthorizeNativeApplication(OAuthScope scope) |
java.lang.String |
getClientId() |
java.lang.String |
getClientSecret() |
OAuth2Tokens |
getOAuth2Tokens() |
protected java.lang.String |
getTypeName() |
java.lang.String |
getVersionPrefix() |
void |
retrieveOAuth2TokensFromAuthorization(java.lang.String authorizationCode) |
void |
setOAuth2Tokens(OAuth2Tokens tokens) |
getAccessKey, getDataToEncrypt, getFriendlyName, getLogString, getSecretKey, hasFriendlyName, load, load, save, save, save, save
public OAuth2Credentials(java.lang.String clientId, java.lang.String clientSecret)
clientId
- Client ID to identify the application to an OAuth2 end-point.clientSecret
- Client Secret for the application to authenticate against an OAuth2 end-point.public OAuth2Credentials(java.lang.String clientId, java.lang.String clientSecret, java.lang.String friendlyName)
clientId
- Client ID to identify the application to an OAuth2 end-point.clientSecret
- Client Secret for the application to authenticate against an OAuth2 end-point.friendlyName
- a name identifying the owner of the credentials, such as 'James'.public OAuth2Credentials(java.lang.String clientId, java.lang.String clientSecret, java.lang.String friendlyName, java.lang.String refreshToken)
clientId
- Client ID to identify the application to an OAuth2 end-point.clientSecret
- Client Secret for the application to authenticate against an OAuth2 end-point.friendlyName
- a name identifying the owner of the credentials, such as 'James'.refreshToken
- a refresh token that was obtained previously.public OAuth2Credentials(OAuthUtils oauth, java.lang.String friendlyName)
oauth
- ImplementationfriendlyName
- a name identifying the owner of the credentials, such as 'James'.public OAuth2Credentials(OAuthUtils oauth, java.lang.String friendlyName, java.lang.String refreshToken)
oauth
- ImplementationfriendlyName
- a name identifying the owner of the credentials, such as 'James'.refreshToken
- a refresh token that was obtained previously.public void setOAuth2Tokens(OAuth2Tokens tokens)
public OAuth2Tokens getOAuth2Tokens() throws java.io.IOException
java.io.IOException
public java.lang.String generateBrowserUrlToAuthorizeNativeApplication(OAuthScope scope)
public void retrieveOAuth2TokensFromAuthorization(java.lang.String authorizationCode) throws java.io.IOException
java.io.IOException
public java.lang.String getClientId()
public java.lang.String getClientSecret()
protected java.lang.String getTypeName()
getTypeName
in class ProviderCredentials
public java.lang.String getVersionPrefix()
getVersionPrefix
in class ProviderCredentials