a month ago
Hi,
I am currently working on a project that involves integrating with an external API, and I've encountered a challenge regarding the storage and management of authentication tokens. I've implemented a common function that checks if the token exists in lookup tables, verifies the token expiration date, and fetches a new token if the old one has expired, in the same time updating the lookup value. Note that the token value needs to be passed in the Authorization header and it's expiration date currently is around 1 day - therefore the need for a "refresh" function. We don't want to fetch new token with every call.
The problem I have with that solution is that the token value is exposed to everyone (with role access) in the lookup tables view as well as in the job logs.
Is there a better solution/best practices in Workato for such cases?
Cheers!
Solved! Go to Solution.
2 weeks ago
a month ago - last edited a month ago
Hi @dawidleman ,
I had a similar issue with one of my integrations. What I did was use Workato's encrypt function to encrypt the newly generated token and then stored it in a lookup table. Please note, this encrypt function requires an encryption key to perform the encryption. We have put an encryption key in the system property, which is hidden. So, when you want to use the access key from the lookup table, use the decrypt function along with the environment property.
Although this way the data is still exposed, it is encrypted. If someone wants to breach the data, they would need to decrypt it technically. Also, make sure to mask the steps where you are decrypting the data so it won't be visible in the job within the Refresh window.
Please let us know if you find a better solution.
2 weeks ago
2 weeks ago
Call me lazy, but I would just fetch a new token with every call. Problem solved!