boundary config get-token
config get-token command fetches a token stored by the Boundary CLI.
The following command gets the token stored by the Boundary CLI:
$ boundary config get-token
This command can be useful in various situations. For example, developers could share a line such as the following in a shell script, such that each developer on their own machine executes the script using their own Boundary token:
$ curl --header "Authorization: Bearer $(boundary config get-token)" \ --header "Content-Type: application/json" \ http://127.0.0.1:9200/v1/roles/r_1234567890
This command keeps parity with the behavior of other Boundary commands; if you set the
BOUNDARY_TOKEN environment variable, it overrides the value loaded
from the system store. Not only does this keep parity, but it also allows
examples such as the one above to work even if there is no stored token, but you specified
an environment variable.
$ boundary config get-token [options] [args]
-account-id- Prints out the account ID associated with the token instead of the token itself, if specified. The default value is
-auth-method-id- Prints out the auth method ID associated with the token instead of the token itself, if specified. The default value is
(string: "")- Indicates the type of keyring to use. This value defaults to
autowhich uses the Windows credential manager, OSX keychain, or cross-platform password store depending on the platform. Set this value to
noneto disable keyring functionality. The following keyring types are available, depending on platform:
You can also specify the keyring type using the BOUNDARY_KEYRING_TYPE environment variable.
(string: "")- Indicates whether the given value should be used as the name when loading the token from the system credential store. This value must correspond to a name used when authenticating. You can also specify the token name using the BOUNDARY_TOKEN_NAME environment variable.
-user-id- Prints out the user ID associated with the token instead of the token itself, if specified. The default value is