Create External Client App (Salesforce)
-
Go to Setup > External Client App Manager
-
Create new External Client App
-
Call it Salesforce
-
Distribution state = Local
-
Go to API (Enable OAuth Settings)
-
Enable OAuth
-
Make a placeholder in Callback URL: “e.g. https://acme.sharepoint.com/services/authcallback/Salesforce”
-
Select as scopes: Api, Offline_access, Refresh_token
-
Click Create
-
Go to Settings > OAuth Settings
-
Click on Consumer Key and Consumer Secret (and copy/save them)
Create another Salesforce Auth Provider
-
Go to Setup > Auth. Providers > New
-
Fill in details:
|
Field |
Value |
|---|---|
|
Provider Type |
Salesforce |
|
Name |
|
|
URL-suffix |
|
|
Consumer Key |
Consumer Key from the External Client App |
|
Consumer Secret |
Consumer Secret from the External Client App |
|
Default scopes |
|
-
Uncheck checkbox "Use Proof Key for Code Exchange (PKCE) Extension"
Setting Up External Credentials & Named Credentials in Salesforce
Create a New External Credential
-
Go to Setup → search for Named Credentials → select the External Credentials tab
-
Click New
-
Fill in the fields:
-
Label: Salesforce
-
Name: Salesforce
-
Authentication Protocol: OAuth 2.0
-
Authentication Flow Type: Browser Flow
-
Identity Provider: Select Auth Provider and choose your Salesforce auth provider
-
-
Leave Scope and Additional Status Codes for Token Refresh blank
-
Click Save
Create the Principal
-
After saving, scroll down to the Principals section on the External Credential detail page
-
Click New or open the existing principal
-
Confirm/set:
-
Parameter Name: Principle
-
Sequence Number: 1
-
Identity Type: Named Principal
-
Leave Scope blank
-
-
Click Save
Authenticate the Principal
-
Back on the External Credential detail page, scroll to the Principals section
-
You'll see the principal listed with Authentication Status: Not Configured
-
Click the dropdown arrow on the right → select Authenticate
-
A browser pop-up will appear asking you to log in and authorize the Salesforce org
-
Complete the OAuth flow — once done, the Authentication Status will update to Authenticated
Create/Edit the Named Credential
-
Still in Named Credentials, go to the Named Credentials tab
-
Click New (or edit an existing one)
-
Fill in:
-
Label: Salesforce1
-
Name: Salesforce1
-
Important: Label and Name must be exactly Salesforce1 (case-sensitive).
-
URL: your org's URL (e.g. https://acme.my.salesforce.com )
-
Under Authentication, set External Credential to the External Credential you created earlier
-
Click Save
Configure Permission Set
-
Create or edit permission set for users who need document access
-
Add "External Credential Principal Access" for the Principal from Authenticate the Principle
-
Add Read permissions for "User External Credentials"