How to use secure string in http request activity

I’m making an oauth2 authentication request to retrieve the salesforce api token. I would like to pass this as a secure string in the http request activity, but UiPath does not allow it. This ends up creating a loophole for anyone who has access to the code to obtain these credentials.

Im storaging the credentials in credentials assets.

Is there any other better solution than converting secure string to a string?

Hello @Camila_Caldas

Since the HTTP Request activity does not accept SecureString directly, you need to convert the SecureString to a regular String. Here’s how you can do it:

new System.Net.NetworkCredential(“”, yourSecureString).Password