How to use SecureString with GetAppCredentials?


I am not able to properly communicate SecureString (password) from GetAppCredentials to its invoker workflow.

I can successfully retrieve the username and the password in GetAppCredentials (the password is 12 characters long).

But for whatever reason when I try to manipulate the password in the parent workflow, it indicates that the password is 0 character long…

Any idea where I should look to solve this issue?

Best regards,

What are you using to print the “my pwd is %numberOfCharacters%” line?

Log message with value:
"my pwd is " + password.Length.ToString

You can check that the password string is correct by converting the secure string to string and then using a write line. Then you can check the length is correct.

To convert:
password = new System.Net.NetworkCredential(string.Empty, securePassword).Password


But the goal here is to have a value in the variable supposed to retrieve the output from GetAppCredentials and that it stay secure, I do not want to unsecure a password.

And I did try your conversion but same result, the length is still 0.

So any idea why I cannot have a value after the binding?


Sorry maybe I wasn’t clear, I just meant to use this to check that the password string is correct, becasue sounds like it’s not quite write. After converting to string you can check if correct by using write line.

Ok, but I did try, but still nothing, it’s almost like the secureString in GetAppCredentials is not outputted into the arguments.

The binding result in an empty string…

Is the credential stored in windows credential manager? Perhaps try remaking the cred?

If this doesn’t work perhaps try remaking the invoke for the getappcredentials

No I get them from the orchestrator’s assets.

As shown in the screenshot, I do correctly retrieve the credential from the orchestrator (the password is 12 characters long), but when I try to use it in the workflow summoning the getAppCredentials one, I do have the correct entry for the username but the password is empty.

Ah I see, maybe try recreating the invoke in which you grab the cred values. I’m sure you’ve already done this but just make sure no other activties are resetting the value of the password variable.


I did not tried to recreate the invoke, just did, and it did the trick, cannot believe I got stuck on this for so long -_-!

Thanks a lot!

1 Like

No problem! Sometimes the easiest solution is the best I guess, it’s so easy to overlook though!

Glad I could help

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