Named Credentials - A turning point for callouts in Apex

What are Named Credentials?
  1. Specifies the URL of a callout endpoint and its required authentication parameters(methods & urls) with point & click.
  2. Can be seen as advance version of remote site settings in one scenario but it has totally different purpose. Remote site settings are not required for this.
  3. Named credentials handles all authentication requirements like headers to be set etc.
  4. It is an alternate of using remote site settings with apex code handling. It is much more secure.
  5. Supports two types of authentication protocols for now : Basic Authentication(Password authentication) or OAuth.
  6. Can be configured easily if Authentication needs to be done in User Context or Admin Context
OAuth Protocol:
This requires a proper setup of Auth provider in salesforce with configurations like consumer key, consumer secret, callback url.
We can also connect two orgs with this method.To connect with another salesforce, connected app needs to be created in one org & Auth provider & named credentials need to be configured in another.

Comments

Popular posts from this blog

Adding a red asterisk to required fields using label in LWC

The Developer Console didn't set the DEVELOPER_LOG trace flag on your user. Having an active trace flag triggers debug logging. You have 1,978 MB of the maximum 1,000 MB of debug logs. Before you can edit trace flags, delete some debug logs.

Salesforce: Serial and Parallel Approval