FAQ-000466 - Custom Settings and Configuration Security / Duplicate Questions

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
Should I use Named Credentials instead of storing API tokens in custom settings?
Answer
Yes, you should use Named Credentials instead of storing API tokens in custom settings. Named Credentials provide a secure and managed way to handle authentication data, such as API tokens, while ensuring sensitive information is not exposed. They also integrate better with Salesforce's security features and simplify making authenticated callouts.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
ApexSuggestUsingNamedCred
Question
Should I use Named Credentials instead of storing API tokens in custom settings?
Recommended Answer Update
Yes, you should use Named Credentials instead of storing API tokens in custom settings. Named Credentials provide a secure and managed way to handle authentication data, such as API tokens, while ensuring sensitive information isn't exposed. They also integrate better with Salesforce's security features and simplify making authenticated callouts.
Reasoning
The FAQ content is accurate and well-structured. The only minor improvement made was changing 'is not exposed' to 'isn't exposed' to follow the conversational tone guidelines that recommend using contractions. This makes the response sound more natural and friendly while maintaining all the technical accuracy. For the related security rule ApexSuggestUsingNamedCred: This rule is directly relevant because it suggests using Named Credentials for secure authentication in Apex code. The FAQ's core message about preferring Named Credentials over storing API tokens in custom settings aligns perfectly with this rule's purpose. The FAQ content specifically discusses 'storing API tokens' and recommends 'Named Credentials' as the secure alternative, which is exactly what this security rule promotes.
Reasoning References