Credential Store
Samples
The
CreateUser
and
SimpleAgent
sample applications
demonstrate how to use the credential store client libraries.
- TheCreateUsersample creates a user account and password for the server based on random-number-generation scheme. The sample populates the local credential store backing file with this information. If the backing file does not exist, it is created in the default location.When you runCreateUser, specify the name of an ESXi system, and an administrator user name and password. A user account name and password are created on the server. Specify--ignorecertunless your system has a secure connection to the target. Do not use--ignorecertin a production environment.java com.vmware.samples.simpleagent.CreateUser --server <servername> --url https://<servername>/sdk --username <adminuser> --password <pwd> --ignorecert ignorecertTheCreateUsersample application is for demonstration purposes only and should not be used as a model for production code. The sample breaks the principle of least privilege by granting the user account the Administrator role (-1). Never do this in a production environment.
- TheSimpleAgentsample application demonstrates how to use credential store libraries to extract the user account and password at runtime to authenticate a user noninteractively.java com.vmware.samples.simpleagent.SimpleAgent <servername>