Thursday, 17 October 2024

Named Credentials and Remote Site Settings

 𝐂𝐨𝐦𝐩𝐚𝐫𝐢𝐬𝐨𝐧 𝐛𝐞𝐭𝐰𝐞𝐞𝐧 𝐍𝐚𝐦𝐞𝐝 𝐂𝐫𝐞𝐝𝐞𝐧𝐭𝐢𝐚𝐥𝐬 𝐚𝐧𝐝 𝐑𝐞𝐦𝐨𝐭𝐞 𝐒𝐢𝐭𝐞 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 



1) Named Credentials in Salesforce support a variety of authentication flows, including:

  • No Authentication
  • Password Authentication
  • OAuth 2.0 (Web Server Flow, User-Agent Flow, JWT Bearer Token Flow)
  • OAuth 2.0 SAML Bearer Assertion Flow
  • Client Certificate Authentication


🚀 𝐍𝐚𝐦𝐞𝐝 𝐂𝐫𝐞𝐝𝐞𝐧𝐭𝐢𝐚𝐥𝐬 :

▶️ Used for secure and easy authentication with external services, such as APIs.
Support various authentication methods, including Password Authentication, OAuth 2.0, and JWT (JSON Web Token).
 
▶️ Store credentials securely, separating the authentication details from the code. Passwords and tokens are stored in a dedicated credential record.
 
▶️ Ideal for API integrations where authentication is required. It abstracts and centralizes credential management.
 
▶️ Typically used for callouts made from Apex code, such as when making HTTP requests to external services.
 
▶️ Allows administrators to control access and permissions at a granular level, specifying which users or profiles can use specific Named Credentials.

🚀 𝐑𝐞𝐦𝐨𝐭𝐞 𝐒𝐢𝐭𝐞 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 :

▶️ Used to enable communication from Salesforce to external websites over HTTPS. It helps Salesforce understand which external domains are safe to access.
 
▶️ Do not handle authentication directly. They focus on specifying trusted domains for making client-side requests
 
▶️ Do not store credentials. They are more about defining the allowed domains for client-side interactions.
 
▶️ Primarily used for client-side requests from Lightning components, Visualforce pages, or JavaScript remoting.
 
▶️ Appropriate for scenarios where the interaction is client-side, such as making AJAX requests or loading resources from external domains.
 
▶️ Do not provide granular access control for individual users or profiles. They are applied at the organization level.


🚀 𝐖𝐡𝐞𝐧 𝐓𝐨 𝐔𝐬𝐞 𝐍𝐚𝐦𝐞𝐝 𝐂𝐫𝐞𝐝𝐞𝐧𝐭𝐢𝐚𝐥𝐬 𝐚𝐧𝐝 𝐑𝐞𝐦𝐨𝐭𝐞 𝐒𝐢𝐭𝐞 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 :

𝐍𝐚𝐦𝐞𝐝 𝐂𝐫𝐞𝐝𝐞𝐧𝐭𝐢𝐚𝐥𝐬 :

✅ You need to make server-side callouts.
✅ Authentication with an external service is required.
✅ You want to centralize and secure credential management.

𝐑𝐞𝐦𝐨𝐭𝐞 𝐒𝐢𝐭𝐞 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 :

✅ You are making client-side requests.
✅ You need to enable communication with specific external domains.
✅ You are not dealing with server-side authentication but rather allowing client-side requests to external sites.



🤝 DM | Follow Jyothi SB to connect.
🚀 Let's connect and discover together.

No comments:

Post a Comment

Heap Size and Apex CPU Time Limit

  Heap Size - 1) Memory size for holding object , variables and records 2) CPU Time limit -  1) time consuming during whole transaction   ...