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,
String friendlyName) |
OAuth2Credentials(OAuthUtils oauth,
String friendlyName,
String refreshToken) |
OAuth2Credentials(String clientId,
String clientSecret)
Construct credentials.
|
OAuth2Credentials(String clientId,
String clientSecret,
String friendlyName)
Construct credentials, and associate them with a human-friendly name.
|
OAuth2Credentials(String clientId,
String clientSecret,
String friendlyName,
String refreshToken)
Construct credentials, and associate them with a human-friendly name.
|
Modifier and Type | Method and Description |
---|---|
String |
generateBrowserUrlToAuthorizeNativeApplication(OAuthScope scope) |
String |
getClientId() |
String |
getClientSecret() |
OAuth2Tokens |
getOAuth2Tokens() |
protected String |
getTypeName() |
String |
getVersionPrefix() |
void |
retrieveOAuth2TokensFromAuthorization(String authorizationCode) |
void |
setOAuth2Tokens(OAuth2Tokens tokens) |
getAccessKey, getDataToEncrypt, getFriendlyName, getLogString, getSecretKey, hasFriendlyName, load, load, save, save, save, save
public OAuth2Credentials(String clientId, 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(String clientId, String clientSecret, 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(String clientId, String clientSecret, String friendlyName, 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, String friendlyName)
oauth
- ImplementationfriendlyName
- a name identifying the owner of the credentials, such as 'James'.public OAuth2Credentials(OAuthUtils oauth, String friendlyName, 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 IOException
IOException
public String generateBrowserUrlToAuthorizeNativeApplication(OAuthScope scope)
public void retrieveOAuth2TokensFromAuthorization(String authorizationCode) throws IOException
IOException
public String getClientId()
public String getClientSecret()
protected String getTypeName()
getTypeName
in class ProviderCredentials
public String getVersionPrefix()
getVersionPrefix
in class ProviderCredentials
Copyright © 2006–2018. All rights reserved.