Package com.github.scribejava.apis
Class SalesforceApi
- java.lang.Object
-
- com.github.scribejava.core.builder.api.DefaultApi20
-
- com.github.scribejava.apis.SalesforceApi
-
- All Implemented Interfaces:
com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service>
public class SalesforceApi extends com.github.scribejava.core.builder.api.DefaultApi20This class is an implementation of the Salesforce OAuth2 API. The default implementation connects to the Salesforce production environment. If you want to connect to a Sandbox environment you've to usesandbox()method to get sandbox instance of this API
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSalesforceApi(java.lang.String hostName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAccessTokenEndpoint()com.github.scribejava.core.extractors.TokenExtractor<com.github.scribejava.core.model.OAuth2AccessToken>getAccessTokenExtractor()com.github.scribejava.core.model.VerbgetAccessTokenVerb()protected java.lang.StringgetAuthorizationBaseUrl()com.github.scribejava.core.oauth2.clientauthentication.ClientAuthenticationgetClientAuthentication()static voidinitTLSv11orUpper()Salesforce API requires to use TLSv1.1 or upper.static SalesforceApiinstance()static SalesforceApisandbox()
-
-
-
Constructor Detail
-
SalesforceApi
protected SalesforceApi(java.lang.String hostName)
- Parameters:
hostName- The hostname to be used, which is eitherPRODUCTION_HOSTorSANDBOX_HOST.
-
-
Method Detail
-
instance
public static SalesforceApi instance()
-
sandbox
public static SalesforceApi sandbox()
-
getAccessTokenVerb
public com.github.scribejava.core.model.Verb getAccessTokenVerb()
- Overrides:
getAccessTokenVerbin classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAccessTokenEndpoint
public java.lang.String getAccessTokenEndpoint()
- Specified by:
getAccessTokenEndpointin classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAuthorizationBaseUrl
protected java.lang.String getAuthorizationBaseUrl()
- Specified by:
getAuthorizationBaseUrlin classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAccessTokenExtractor
public com.github.scribejava.core.extractors.TokenExtractor<com.github.scribejava.core.model.OAuth2AccessToken> getAccessTokenExtractor()
- Overrides:
getAccessTokenExtractorin classcom.github.scribejava.core.builder.api.DefaultApi20
-
initTLSv11orUpper
public static void initTLSv11orUpper() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.io.IOExceptionSalesforce API requires to use TLSv1.1 or upper.Java 8 have TLS 1.2 enabled by default. java 7 - no, you should invoke this method or turn TLS>=1.1 somehow else
- Throws:
java.security.NoSuchAlgorithmException- in case your jvm doesn't support TLSv1.1 and TLSv1.2java.security.KeyManagementException- unexpected Exception fromSSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)java.io.IOException- unexpected Exception fromSocketFactory.createSocket()
-
getClientAuthentication
public com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication getClientAuthentication()
- Overrides:
getClientAuthenticationin classcom.github.scribejava.core.builder.api.DefaultApi20
-
-