VMware Cloud Community
jmedd
Enthusiast
Enthusiast
Jump to solution

How to use the Credential object?

I had a requirement to create a password confirmation form in vCO. I detailed what I came up with here:

http://www.jonathanmedd.net/2015/01/presenting-a-password-confirmation-form-in-vco-vro.html

It was suggested in the comments that:

"A better way would be to use an input of type “credential” (which does include natively the confirm password check)."

While the credential object solves the problem of the password confirmation very nicely, it introduces a new issue in that I am struggling to work with its content when working in the workflow having used it as an input.

I tried to use the credential object once before, but had issues with the password property. Once inside the workflow the password property does not seem to be available. The API explorer for the password property states “[Deprecated]Passwords are not available in scripting”. For example, say I want to use the credentials with the ‘Run Program in Guest’ workflow, I need to supply a username (String) and password (SecureString), but just picking out the username and password properties of the credential object fails to work. I can confirm in the workflow by using the checkPassword method that the password matches a known value. However, when trying to use the password property and assign it to another workflow requiring a password authentication always fails.

Does anybody have any examples of how to use the credential object in terms of working with the password inside the workflow in scriptable tasks or other workflows?

Thanks 🙂

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I did not realize this was the case.

Certainly it was a fix to avoid someone doing a server.getCredential() in a workflow to steal user passwords.

If so the credential object can only be used to set the methods taking it as parameter.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
2 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I did not realize this was the case.

Certainly it was a fix to avoid someone doing a server.getCredential() in a workflow to steal user passwords.

If so the credential object can only be used to set the methods taking it as parameter.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
jmedd
Enthusiast
Enthusiast
Jump to solution

OK, great. Thanks for the info.

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
Reply
0 Kudos