Class 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 use sandbox() method to get sandbox instance of this API
    • Constructor Detail

      • SalesforceApi

        protected SalesforceApi​(java.lang.String hostName)
        Parameters:
        hostName - The hostname to be used, which is either PRODUCTION_HOST or SANDBOX_HOST.
    • Method Detail

      • getAccessTokenVerb

        public com.github.scribejava.core.model.Verb getAccessTokenVerb()
        Overrides:
        getAccessTokenVerb in class com.github.scribejava.core.builder.api.DefaultApi20
      • getAccessTokenEndpoint

        public java.lang.String getAccessTokenEndpoint()
        Specified by:
        getAccessTokenEndpoint in class com.github.scribejava.core.builder.api.DefaultApi20
      • getAuthorizationBaseUrl

        protected java.lang.String getAuthorizationBaseUrl()
        Specified by:
        getAuthorizationBaseUrl in class com.github.scribejava.core.builder.api.DefaultApi20
      • getAccessTokenExtractor

        public com.github.scribejava.core.extractors.TokenExtractor<com.github.scribejava.core.model.OAuth2AccessToken> getAccessTokenExtractor()
        Overrides:
        getAccessTokenExtractor in class com.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.2
        java.security.KeyManagementException - unexpected Exception from SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)
        java.io.IOException - unexpected Exception from SocketFactory.createSocket()
      • getClientAuthentication

        public com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication getClientAuthentication()
        Overrides:
        getClientAuthentication in class com.github.scribejava.core.builder.api.DefaultApi20