Forum Discussion

kbeeveer46's avatar
kbeeveer46
Copper Contributor
Aug 18, 2021

How do I hide/encrypt connection strings or API keys in my web parts?

I am making API calls in my web parts to get information from other apps within our company (not hosted in SharePoint).  I am storing the API keys and connection strings (urls) to these APIs in a set...
  • Joel Rodrigues's avatar
    Aug 19, 2021
    For APIs, they should be secured with Azure AD and requests should be authenticated in order to reach the API, so should not be a problem if the API URL is discovered by users as they would still need to authenticate.
    Regarding API keys for services that may not support authentication, I would recommend creating a simple API to handle all the user requests. Like above, API would be secured by Azure AD and receive only authenticated requests from users. The keys to the last API could be secured with KeyVault and retrieved by your API when needed, so all handled on the backend and never exposed in the browser

    Hope this helps

Resources