Updates to identity docs.
This commit is contained in:
@@ -55,14 +55,20 @@ You can also set VAULT_TOKEN with the following command:
|
||||
export VAULT_TOKEN=$(vault login -token-only -method=userpass username="your-username")
|
||||
```
|
||||
|
||||
> **Note:** The `-token-only` is an equivalent of `-field=token -no-store` options.
|
||||
|
||||
You can also use the following command to set VAULT_TOKEN and TOKEN_ACCESSOR:
|
||||
or a function like this:
|
||||
|
||||
```bash
|
||||
export TOKEN_ACCESSOR=$(vault token lookup -format=json | jq -r .data.accessor)
|
||||
function v_login() {
|
||||
local VAULT_USERNAME=${1:-"your-username"}
|
||||
vault login -format=json -method=userpass username="$VAULT_USERNAME" |
|
||||
jq -r '.auth | [.client_token, .accessor] | @tsv' | read -r VAULT_TOKEN TOKEN_ACCESSOR
|
||||
echo "Logged in as $VAULT_USERNAME (Token accessor: $TOKEN_ACCESSOR)"
|
||||
export VAULT_TOKEN TOKEN_ACCESSOR
|
||||
}
|
||||
```
|
||||
|
||||
> **Note:** The `-token-only` is an equivalent of `-field=token -no-store` options.
|
||||
|
||||
You can then use the `TOKEN_ACCESSOR` to look up token details without exposing the actual token.
|
||||
|
||||
```bash
|
||||
@@ -96,3 +102,6 @@ Read user details:
|
||||
```bash
|
||||
vault read auth/userpass/users/username
|
||||
```
|
||||
|
||||
## Entities and Groups
|
||||
|
||||
|
||||
Reference in New Issue
Block a user