Credential Store Samples

The
CreateUser
and
SimpleAgent
sample applications demonstrate how to use the credential store client libraries.
  • The
    CreateUser
    sample 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 run
    CreateUser
    , 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
    --ignorecert
    unless your system has a secure connection to the target. Do not use
    --ignorecert
    in a production environment.
    java com.vmware.samples.simpleagent.CreateUser --server <servername> --url https://<servername>/sdk --username <adminuser> --password <pwd> --ignorecert ignorecert
    The
    CreateUser
    sample 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.
  • The
    SimpleAgent
    sample 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>