Hi Martin,
The solution is to put your vault invocation in a separate script (
getVault.wal). When you call this script from another script (
convertSecureStringtoString.wal), the secure string is coerced to a string. See code below.
Be aware that the secure string is now a 'normal' string so its value can be seen in the debugger. Clearly, this is not a perfect solution as your password is converted to plain text. Hopefully, in the future, we will allow secure strings to be sent to the terminal.
ConvertSecureSctringToString.waldefVar --name success
--type Boolean
defVar --name user
--type String
defVar --name password
--type String
defVar --name creds
--type String
executeScript --isfromfile --filename "
getVault.wal"
--output "api_key_user=
${user},api_key_password=
${password}" success=value
setVar --name "
${creds}"
--value "
${user}:
${password}"
logMessage --message "Creds:
${creds}"
--type "Info"
getVault.wal
defVar --name api_key_user --type String --output
defVar --name api_key_password --type SecureString --output
defVar --name success --type Boolean --output
getVaultItem --name RPA_API_KEY --system success=success api_key_user=userName api_key_password=password
------------------------------
NIGEL CROWTHER
------------------------------
Original Message:
Sent: Wed December 22, 2021 11:48 AM
From: Martin Medina
Subject: Sending Secure String to Terminal?
Has anyone found a way in order to enter a secure string into a terminal? "Send Text to Terminal" does not allow it, and the terminal requires a username and password entry that is currently stored in a system vault credential.
------------------------------
Martin Medina
------------------------------