Secure Password from OpenIAP

Hi, this may be a simple question, but how do I get the secure password credential from OpenIAP and add it to a text box using OpenRPA? I’ve created a SecureString variable for username and password in openRPA and I am able to get the username securely using the OpenRPA,OpenFlowDB Get Credentials method, however when I try to use the securestring variable to type it into the password field, I get an exception that it cannot convert securestring to string. My sequence so far is Get Credentials, then Enter Username (writeline for confirm), hit TAB, then Type Text for Password.

Any assistance is greatly appreciated!

Secure string has some extra protections like cleaning up the memory. When released, you can read from it using

new System.Net.NetworkCredential(string.Empty, securePassword).Password;

It can be a little annoying to work with, so if you are not working in a highly regulated environment, you can also just use the “UnsecurePassword” property on GetCredentials to get the password in a normal string.

Aside of what Alan wrote, I’d recommend constructing a NetworkCredential object immediately before GetCredential activity (or initialize it in variables default):

With that approach you can access both SecureString and String as needed, can use the Domain for loginUrl or something similar (so makes it easy to pass credentials to test and prod environments), and you don’t “clutter” your workflow with more variables than it really needs + makes it very clear that this is no ordinary string (so should not be logged etc.).

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.