What features does this provide?
![Deploy to Salesforce](https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/deploy.png)
New Connected App
-
Go to Setup > Apps > App Manager
-
Click on New Connected App button
-
Provide a Name, say DataClass_CApp . Add a contact email
-
Select Enable oAuth Setting checkbox
-
Give a Dummy URl for now. We'll update this in just a while
-
Select the 'full' and 'refresh_token' oAuth scopes
-
Save the Connected App
New Auth Provider
-
Go to Setup > Identity > Auth. Providers
-
Click on New button
-
Select Salesforce
-
Provide a Name, say DataClass_AuthProv
-
Copy the Consumer Key and Consumer Secret from new Connected App and paste the Consumer Key and Consumer Secret
-
Add Default Scope as 'refresh_token full'
-
Save the Auth Provider
-
Copy the Callback URL from the Salesforce Configuration section
Update Connected App
- Edit the Connected App, and paste the Callback URl just copied from Auth Provider
New Named Credential 0. Wait for 10 minutes for the Connected App information to flow to servers, before taking the next steps
-
Go to Setup > Security > Named Credentials.
-
Click New Named Credential
-
Enter Label and Name as 'DataClass_NC'
-
Enter the My Domain URL in URL field. Your My Domain can be found in Setup > Company Settings > My Domain
-
Select the Identity Type as 'Named Principal'
-
Select the Authentication Protocol as OAuth 2.0
-
Select the Auth Provider we created in previous step
-
Add Scope as 'refresh_token full'
-
Select 'Start Authentication Flow on Save' and click Save
-
Saving the Named Credential will start an Authentication Flow for this Org. Login once as a SYSTEM ADMIN