# Salesforce Authentication POST-authentication

**URL:** <https://community.auth0.com/t/salesforce-authentication-post-authentication/6121>\
**Category:** Get Help\
**Tags:** auth0-lock, nodejs, api\
**Created:** [April 6, 2017, 1:52am UTC](https://community.auth0.com/t/salesforce-authentication-post-authentication/6121 "2017-04-06T01:52:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevSellOn](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DevSellOn](https://community.auth0.com/u/DevSellOn)\
**Post date:** [April 6, 2017, 1:52am UTC](https://community.auth0.com/t/salesforce-authentication-post-authentication/6121/1 "2017-04-06T01:52:31Z")

</div>

Since the old [Auth0 Forum] is now read-only … this is continuing the research for the following [post](https://auth0.com/forum/t/salesforce-authentication-post-authentication/5463).

So I was able to get the access\_token to the Salesforce API after the following two things:

1. Auth0:

- Changing my Auth0 / Clients / Addons / Principal Property to **email**.
- Download the Auth0 signing certificate.

1. Salesforce:

- Go to Setup … on the left hand side under Build / Create / Apps … under Connected Apps … Edit your connected app.
- Under the accordion “API (Enabled OAuth Settings)” make sure to select “User digital Signatures” and upload the Auth0 certificate from above.
- The “Selected 0Auth Scopes” I chose were:
  - Access and manage your data (api)
  - Full access (full)
  - Perform requests on your behalf at any time (refresh\_token, offline\_access)

I also have the NodeJS request.post I ran … I tried to format it properly in this post, but I am having a hard time, so I have it attached [here](https://community.auth0.com/storage/temp/35-auth0-delegation.txt). You will have to modify the code with your app settings.

### Additional Question

To get the Salesforce API add-on to work in Auth0 I had to copy my Consumer Key assigned by Salesforce to Auth0 / _Addon: Salesforce API_. Technically a one to one relationship. This is fine during my development process, but I am looking to have an app that can be used by many different organizations that use Salesforce.

Is there any documentation / examples of this type of scenario?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [April 6, 2017, 10:48pm UTC](https://community.auth0.com/t/salesforce-authentication-post-authentication/6121/2 "2017-04-06T22:48:08Z")

</div>

The association, like you mentioned, is one to one but you can represent your multi-tenant application as more than one client application record within Auth0. In this scenario each organization would be represented by a client application. This will increase complexity, but that’s always the case when an application has to deal with different tenants/organizations in a unique way.

You could even leverage the [Management API to automatically provision a client application](https://auth0.com/docs/api/management/v2#!/Clients/post_clients) with the correct Salesforce configuration for each of the organizations you integrate with and make this process a self-service one where an organization would provide their Salesforce integration information at the time they register with you. Your application would then based on the actual tenant/organization accessing it identify itself with Auth0 using the correct client identifier. For example, if your application provided access through a unique subdomain for each organization, you could derive this information based on the URL from which your applications is accessed.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/salesforce-authentication-post-authentication/6121/3 "2018-03-02T05:53:06Z")

</div>


