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.DefaultApi20
This 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 protected
SalesforceApi(java.lang.String hostName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessTokenEndpoint()
com.github.scribejava.core.extractors.TokenExtractor<com.github.scribejava.core.model.OAuth2AccessToken>
getAccessTokenExtractor()
com.github.scribejava.core.model.Verb
getAccessTokenVerb()
protected java.lang.String
getAuthorizationBaseUrl()
com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication
getClientAuthentication()
static void
initTLSv11orUpper()
Salesforce API requires to use TLSv1.1 or upper.static SalesforceApi
instance()
static SalesforceApi
sandbox()
-
-
-
Constructor Detail
-
SalesforceApi
protected SalesforceApi(java.lang.String hostName)
- Parameters:
hostName
- The hostname to be used, which is eitherPRODUCTION_HOST
orSANDBOX_HOST
.
-
-
Method Detail
-
instance
public static SalesforceApi instance()
-
sandbox
public static SalesforceApi sandbox()
-
getAccessTokenVerb
public com.github.scribejava.core.model.Verb getAccessTokenVerb()
- Overrides:
getAccessTokenVerb
in classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAccessTokenEndpoint
public java.lang.String getAccessTokenEndpoint()
- Specified by:
getAccessTokenEndpoint
in classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAuthorizationBaseUrl
protected java.lang.String getAuthorizationBaseUrl()
- Specified by:
getAuthorizationBaseUrl
in classcom.github.scribejava.core.builder.api.DefaultApi20
-
getAccessTokenExtractor
public com.github.scribejava.core.extractors.TokenExtractor<com.github.scribejava.core.model.OAuth2AccessToken> getAccessTokenExtractor()
- Overrides:
getAccessTokenExtractor
in classcom.github.scribejava.core.builder.api.DefaultApi20
-
initTLSv11orUpper
public static void initTLSv11orUpper() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException, java.io.IOException
Salesforce 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:
getClientAuthentication
in classcom.github.scribejava.core.builder.api.DefaultApi20
-
-