R1D39 Secrets in Salesforce
My entire Trailhead journey started because I wanted to write a couple of custom integrations for work. I made a working POC hacking together various bits and pieces of information that I found online, but taking a step back to actually learn how Salesforce works has been really great.
I am ready to make a non-hacky solution to the problem that I initially set out to solve. In order to get this to work though, I need some way to manage secrets within Salesforce so that I can securely store my API authentication token for the third party service that I am integrating with.
Luckily, there is Trailhead module on Secure Secret Storage in Salesforce.
Salesforce offers a feature called Named Credentials which offers a very straightforward way to manage secrets. Specifically those involving authenticating against a third party API.
Rather than hard-coding the value into your code, you can leverage named credentials to store secrets, allowing you to refer to the named credential to access the secret value, as if it were any other variable in your code.Sadly, this did not seem to work for me because the API I was using expects a token in the URL rather than allowing for basic authentication.
There are a couple other strategies in place for storing secrets, but they seem like overkill for my specific project.
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- Now What?
- SQLite DB Migrations with PRAGMA user_version
- Setting up ANTLR4 on Windows
- Dagger Feels Like Magic
- Types and Roles If Not Exists in PostgreSQL
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Useful Bluesky Tools from Robb Knight • Posts • Atom Feed
- Re: Bluesky from Colin Devroe
- From the Red Hell to the Sky of Blue from Straphanger
- We don’t need to use what we make from Derek Sivers blog
- Ubuntu Summit 2024: A joyful experience filled with sorrow from Planet KDE | English
- Sabotage from jwz
- What if My Tribe Is Wrong? from Armin Ronacher's Thoughts and Writings
- It’s the “1998” of the AI Revolution. So Why Can I Safely Ignore It? from The Internet Review
Articles from blogs I follow around the net
[RODEN] Enrique Allen
Roden Readers — The first memory I have of Enrique Allen is from the campus of Stanford. He had just graduated from the d.school and was teaching part-time. We were about to start working together. He was all bounding lightness. That’s the first image: Jum…
via Craig Mod — Writer + Photographer November 21, 202417/11/2024
# Back in May I wrote about being inspired to write a track based on a YouTube comment. I recorded a test not long after and built on that into June. Then the breakdown struck and I had a massive crisis of confidence alongside the depression and anxiety. I …
via Colin Walker - Daily Feed November 21, 2024Cold reading an ADHD affliction
I'm sure there are truly pathological cases of ADHD out there, and maybe taking amphetamines really is a magic pill for some folks. But there clearly is also an entire cottage industry cropping up around convincing perfectly normal people that they …
via David Heinemeier Hansson November 20, 2024Generated by openring