Configuring Authentication

You can authenticate your connection to HubSpot by specifying an access token, or by providing your HubSpot application information so that the connector retrieves and uses the corresponding access token.

For detailed configuration instructions, see the following sections:

Using an Access Token

If you already have a valid access token, you can authenticate your connection by providing the token in the connection URL.

By default, access tokens expire after some time. You can configure the connector to automatically refresh the access token upon expiry so that your authentication settings remain valid for all subsequent connections. To do this, include your HubSpot application information along with the access token. You must also provide an appropriate SSL certificate and password for encrypting the OAuth 2.0 access token retrieval process.

To authenticate using an access token:

  • Connect to the server using a connection URL written in the following format:
  • jdbc:hubspot://localhost;Host=[InstanceURL];Auth_Type=Access Token;Auth_AccessToken=[AccessToken]

    The variables are defined as follows:

  • [InstanceURL] is the URL of the HubSpot server you are connecting to.
  • [AccessToken] is your access token for authenticating to HubSpot.

For example:

jdbc:hubspot://localhost;Host=https://api.hubapi.com;Auth_Type=Access Token;Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+5VE

To automatically retrieve a new access token after expiry:

  • Connect to the server using a connection URL written in the following format:
  • jdbc:hubspot://localhost;Host=c;Auth_Type=OAuth 2.0;Auth_AccessToken=[YourAccessToken];Auth_BaseRedirectUri=[RedirectURL];Auth_Client_ID=[YourClientID];Auth_Client_Secret=[YourClientSecret];TrustCertsPath=[Keystore];TrustCertsPwd=[SSLPassword]

    The variables are defined as follows:

  • [InstanceURL] is the URL of the HubSpot server you are connecting to.
  • [YourAccessToken] is your OAuth 2.0 access token for authenticating to HubSpot.
  • [RedirectURL] is the redirect URL associated with your HubSpot application.
  • [YourClientID] is the client ID associated with your HubSpot application.
  • [YourClientSecret] is the client secret associated with your HubSpot application.
  • [KeyStore] is the full path and name of the keystore that contains a password-protected SSL certificate used for proving the identity of the connector to the HubSpot server.
  • [SSLPassword] is the password for decrypting the SSL certificate.

jdbc:hubspot://localhost;Host=https://api.hubapi.com;Auth_Type=OAuth 2.0;Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+8vw;Auth_BaseRedirectUri=https://localhost:6367;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=5kn9Pcyq9pr4lvu123pfl4r57;TrustCertsPath=C:\\Users\\MyKeystore.p12;TrustCertsPwd=jsmith

Using Your HubSpot Application Information

If you do not already have a valid access token, you can configure the connector to retrieve and use one based on your HubSpot application information. To do this, provide the client ID and secret associated with your HubSpot application in the connection URL. You must also provide an appropriate SSL certificate and password for encrypting the OAuth 2.0 access token retrieval process.

To authenticate using your HubSpot application information:

  • Connect to the server using a connection URL written in the following format:
  • jdbc:hubspot://localhost;Host=[InstanceURL];Auth_Type=OAuth 2.0;Auth_BaseRedirectUri=[RedirectURL];Auth_Client_ID=[YourClientID];Auth_Client_Secret=[YourClientSecret];TrustCertsPath=[Keystore];TrustCertsPwd=[SSLPassword]

    The variables are defined as follows:

  • [InstanceURL] is the URL of the HubSpot server you are connecting to.
  • [RedirectURL] is the redirect URL associated with your HubSpot application.
  • [YourClientID] is the client ID associated with your HubSpot application.
  • [YourClientSecret] is the client secret associated with your HubSpot application.
  • [KeyStore] is the full path and name of the keystore that contains a password-protected SSL certificate used for proving the identity of the connector to the HubSpot server.
  • [SSLPassword] is the password for decrypting the SSL certificate.

For example:

jdbc:hubspot://localhost;Host=https://api.hubapi.com;Auth_Type=OAuth 2.0;Auth_BaseRedirectUri=https://localhost:6367;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=5kn9Pcyq9pr4lvu123pfl4r57;TrustCertsPath=C:\\Users\\MyKeystore.p12;TrustCertsPwd=jsmith