In this tutorial, we white-label OAuth 2.0 for HubSpot by creating a developer app in your HubSpot developer account. Skip to step 10 if you already have a developer app. We don't have guides for other apps but the steps will be quite similar.
- Go to HubSpot's developer site.
- Enter your login credentials.
- If you don't have a developer account on HubSpot, you can create one for free.
- Go to Apps.
- Click "Create app".
- In the "App Info" tab, enter your app's name.
- The name you enter here will appear on the authentication and authorization screens when your users will set up a flow with HubSpot.
- Upload your app's logo.
- The logo you upload here will appear on the authentication and authorization screens when your users will set up a flow with HubSpot.
- Go to the Auth tab and enter
https://app.integry.io/auth/redirect/
as the redirect URL.- When your users connect their HubSpot account while setting up the integration, they will be taken to HubSpot's authentication server. After being verified by the authentication server, they will be redirected to the above URL.
- Scroll down to select scopes.
- Scopes will determine the permissions to read/write data from/in your HubSpot account.
- Select the following scopes:
-
crm.schemas.deals.read
crm.objects.contacts.read
crm.objects.contacts.write
crm.objects.companies.read
crm.objects.companies.write
crm.lists.read
crm.lists.write
crm.objects.deals.read
crm.objects.deals.write
crm.schemas.contacts.read
crm.schemas.companies.read
content
oauth
-
- Copy each scope and paste it in the search bar.
- Select the "read" or "write" permission by clicking the checkbox. Your selected scope will be added.
- This is how the permissions section will appear on the authorization screen for your users.
- Click on Create App. When your app is created, a "Client ID" and "Client secret" will be generated for your developer app. Go to the "Auth" tab to copy your Client ID and Client secret. You will use these credentials while configuring white-labeled OAuth in Integry.
- Go to the 'Flows' tab.
- Click on the three-dots menu for flow with HubSpot.
- Click on 'Auth Settings.
- Enter your Client ID, Client secret, and scopes in the respective fields.
- The scopes you enter here should match with the scopes you select in your developer app.
- Copy scopes from here:
content oauth crm.schemas.deals.read crm.objects.contacts.write crm.objects.companies.write crm.lists.write crm.objects.companies.read crm.lists.read crm.objects.deals.read crm.schemas.contacts.read crm.objects.deals.write crm.objects.contacts.read crm.schemas.companies.read
- Click Test.
- As a result, an authentication UI opens up in your browser.
- After a successful login, an authorization UI opens in your browser. The permissions you see here are the scopes you selected while creating your app. Click on Connect app.
- If your test is successful, you'll see a green tick.
- In case of an error, you'll see an error icon, click 'See details' to view error details.
- You'll see the steps performed by Integry on behalf of Doneday to authenticate and authorize the user. Check the Network Code to see which step failed.
- Click "View Payload" to see the details of the API call and troubleshoot accordingly. Here are some potential error messages you may encounter:
-
-
invalid_grant
: Indicates that the OAuth client key or secret is not properly configured with the necessary grants or scopes -
BAD_CLIENT_SECRET
: Indicates an invalid or incorrect client secret was provided -
Unauthorized
: Indicates that the client key or secret provided is not authorized to perform the requested action
-
-
- Click on Enable to enable white-labeled OAuth in your flows.
Once enabled, any new users who set up integrations with Hubspot will see your app's branding (instead of Integry) on the Hubspot authorization screen, and we will use your developer app when we call Hubspot's API on their behalf.
However, existing integrations will continue to use Integry's developer app because that's what the existing users used to login. If/When they disconnect their Hubspot account and reconnect, they will also login using your developer app (and not see Integry).