vhsm login
Learn to authenticate users to vHSM server.
The vhsm login
command authenticates users to vHSM using the provided credentials. A successful login generates a token, which functions similarly to a session token on a website. By default, this token is cached on the local machine for future use.
Usage
If no token is provided, authentication defaults to the
token
method and prompts for a token input.Other authentication methods (such as
userpass
,github
, orcert
) can be specified using the-method
flag.If an authentication method is enabled at a non-standard path, use
-path
to specify it.
Examples
1. Login Using the default token method
Input Prompt
Output
2. Login using a token from the command line
Output
3. Login using the userpass
authentication method
userpass
authentication methodInput Prompt
Output
4. Login using the github
authentication method at a custom path
github
authentication method at a custom pathOutput
Command Options
-method
<string>
Specifies the authentication method (e.g., userpass
, ldap
). Defaults to token
.
-path
<string>
Specifies the remote vHSM path where the auth method is enabled. Defaults to the method name (e.g., userpass -> userpass/
).
-no-print
<boolean>
Prevents the token from being displayed. The token is still stored in the configured token helper.
-no-store
<boolean>
Prevents the token from being saved for future requests. It will only be displayed in the command output.
-token-only
<boolean>
Outputs only the token without verification (equivalent to -field=token -no-store
).
Output Options
-field
<string>
Prints only a specific field (e.g., token
) in the format specified by -format
.
-format
<string>
Specifies output format: table
, json
, or yaml
. Default: table
. (VAULT_FORMAT
environment variable can be used.)
Last updated
Was this helpful?