<< Previous | Next >>

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:

  1. Create a new Auth. Provider with the correct OpenID information
  2. Create a new External Credential related to the Auth. Provider, selecting Browser Flow as the means
  3. Create a new Permission Set that will grant access to the External Credential
    • This Permission Set should grant all permissions to the User External Credential object
  4. Map the Permission Set to the External Credential on the External Credential’s detail page
    • Select the appropriate Permission Set and select Named Principle as the scheme
  5. 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
  6. Authenticate to the external system appropriately
  7. Create a new Named Credential related to the External Credential that you’ve created
  8. Use the Named Credential in your code / callouts

References