Daily Learnings: Tue, Apr 04, 2023
It is the mark of an educated mind to be able to entertain a thought without accepting it. — Aristotle
New Named/External Credentials
I finally figured out how to work with the new Salesforce Named Credentials system for external authentication and authorization using OAuth2.0 / OpenID Connect. Example configurations can be found in the SOLVD repo, but basically these are the overall steps:
- Create a new Auth. Provider with the correct OpenID information
- Create a new External Credential related to the Auth. Provider, selecting
Browser Flowas the means - Create a new Permission Set that will grant access to the External Credential
- This Permission Set should grant all permissions to the
User External Credentialobject
- This Permission Set should grant all permissions to the
- Map the Permission Set to the External Credential on the External Credential’s detail page
- Select the appropriate Permission Set and select
Named Principleas the scheme
- Select the appropriate Permission Set and select
- In the row that shows up for the new mapping, click on the dropdown arrow and click “Authenticate”
- If configured correctly, this should take you to the external system where you will authenticate
- Authenticate to the external system appropriately
- Create a new Named Credential related to the External Credential that you’ve created
- Use the Named Credential in your code / callouts