Start a conversation

Configuring OAuth 2 > Salesforce

Overview

This article provides a step-by-step guide for integrating OAuth 2 with Salesforce to enable single sign-on for AdvocateHub users. It covers the creation of a Connected App in Salesforce, configuring the Custom OAuth Provider in AdvocateHub, and specific instructions for connecting with a Salesforce Community, including endpoint adjustments and visual customization options.

 

Information

Note: Single Sign-on may not be available in your plan.

This article will cover how you can configure your OAuth 2 setup in the AdvocateHub using Salesforce. This provides your Advocates with a seamless, easy way to enter your hub once they are logged into a Salesforce app, for example, Salesforce Community.

 

Configuration In Salesforce

You must be an logged into Salesforce as an Administrator to complete these actions.

1. Create an app in Salesforce by going to Build > Create > Apps

2. Scroll down to the Connected Apps section and click the new button.

3. You should be greeted with an initial setup page where you will enter the following information (if we do not reference a field below then it can be left empty)

Field Name Value
Connected App Name Influitive AdvocateHub (This is not important, call it whatever makes most sense for your organization)
API Name Influitive_AdvocateHub (Again, not important, you can choose whatever name you like)
Contact Email  
Enable OAauth Settings (Checkbox) Tick this checkbox
Callback URL https://{{yourhubdomain}}.influitive.com/users/auth/custom_oauth2/callback
Selected OAuth Scopes Access your basic information (id, profile, email, address, phone)
Require Secret for Web Server Flow (Checkbox) Tick this checkbox

It should look something like the below:

4. Save your app, you will get a notification saying that it should take 2-10 minutes for the changes to take effect. Click continue.

5. You should see a page with displays your App information. Keep this page open as we move into the AdvocateHub to complete the setup. Note the Consumer Key and Consumer Secret :

 

Configuration in AdvocateHub

1. In your AdvocateHub, navigate to Integrations > Custom OAuth Provider and click the manage button.

2. Once you are in the integration, go to the Setup tab. Fill out all the fields as below (again, if we do not reference a field below then it can be left empty)

The below values are different if you are connecting with your Salesforce Community, please see the Configuring Salesforce Community section.

Field Name Value
Client ID Grab this from your Salesforce Connected App (Salesforce refers to it as Consumer ID)
Client Secret Grab this from your Salesforce Connected App (Salesforce refers to it as Consumer Secret)
Endpoint https://login.salesforce.com
Token URL https://login.salesforce.com/services/oauth2/token
Authorize URL https://login.salesforce.com/services/oauth2/authorize
Fetch User Path https://login.salesforce.com/services/oauth2/userinfo
UID Lookup user_id
Name Lookup name
Email Lookup email

3. Make sure to save and everything should be up and running!

 

Configuring Salesforce Community

The only difference to worry about when setting up an OAuth connection with your Salesforce Community is to use different Endpoints. Please copy the below settings replacing influitive-comm.force.com with your Salesforce domain and customerportal with the name of your Salesforce Community

Field Name Value
Client ID Grab this from your Salesforce Connected App (Salesforce refers to it as Consumer ID)
Client Secret Grab this from your Salesforce Connected App (Salesforce refers to it as Consumer Secret)
Endpoint https://influitive-comm.force.com/consumerportal/s/login/
Token URL https://influitive-comm.force.com/consumerportal/services/oauth2/token
Authorize URL https://influitive-comm.force.com/consumerportal/services/oauth2/authorize
Fetch User Path https://influitive-comm.force.com/consumerportal/services/oauth2/userinfo
UID Lookup user_id
Name Lookup name
Email Lookup email

 

 

Add Final Cosmetic Touches

1. Staying on the same page you will notice another field called Display Name which will display like below for your Advocates when they are logging in.

2. Finally, you have the option to upload images as you can see above in the previous screenshot above. Look at Salesforce Official Asset Folder for the perfect image for you. simply download the image you want from there or any other source and upload to the hub!

Final Step! Go to the Settings tab of the integration and toggle it On

For more information on Using OAuth2 to authorize applications, check out the Salesforce article on this topic.

 

FAQ

What are the prerequisites for configuring OAuth 2 with Salesforce for AdvocateHub?

You must have Administrator privileges in Salesforce and your plan must support Single Sign-on. Contact your Advocacy Coach for plan details.

How do I create a Connected App in Salesforce for OAuth 2 integration?

Log in to Salesforce with Administrator privileges and create an app in Salesforce, configuring the settings as directed in the article.

What should I do if I'm setting up OAuth 2 for a Salesforce Community?

Use distinct endpoints by replacing the domain and community name in the settings with your Salesforce domain and the name of your Salesforce Community.

How can I customize the display for Advocates during the OAuth login process?

You can upload images for your profile by selecting an image from the Salesforce Official Asset Folder or another source and uploading it to the hub.

How do I enable the OAuth 2 integration in AdvocateHub after configuration?

Navigate to the Settings tab of the integration in AdvocateHub and switch it to 'On' to enable the integration.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments