0

I have implemented a custom auth provider by following the steps from this help guide https://help.salesforce.com/articleView?id=sso_provider_plugin_custom.htm and the setup works as expected.

Now when I want to check in my custom metadata type to the GIT repo I see that the client secret and client key are visible. How can hide these details as it is a piece of sensitive information? Is there a better way to store this?

1

Try a "Named Credential"

If that doesn't fit this use-case another option is creating a custom object to store Client Id, Consumer Secret, and any other tokens using text fields that you encrypt and mask. You can set text fields to mask with asterisks and encrypt the field data, then query the custom object records for your client Id and consumer secret in your code.

| improve this answer | |
  • Thanks, folks for the response. I have been thinking on similar lines but the abstract class Auth.AuthProviderPluginClass requires us to implement metadata method getCustomMetadataType() and return the metadata i.e. implemented to store the OAuth values. – nevrekar_amey May 8 at 4:29
  • Also since I am not developing a managed package and doing development in a developer sandbox it's not allowing me to set Protected for my metadata – nevrekar_amey May 8 at 4:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.