2015-04-18 20:35:55 +00:00
|
|
|
---
|
2020-01-18 00:18:09 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: Token - Auth Methods
|
|
|
|
description: The token store auth method is used to authenticate using tokens.
|
2015-04-18 20:35:55 +00:00
|
|
|
---
|
|
|
|
|
2017-09-13 01:48:52 +00:00
|
|
|
# Token Auth Method
|
2015-04-18 20:35:55 +00:00
|
|
|
|
2022-05-23 21:57:14 +00:00
|
|
|
The `token` auth method is built-in and automatically available at `/auth/token`. It
|
2017-09-13 01:48:52 +00:00
|
|
|
allows users to authenticate using a token, as well to create new tokens, revoke
|
2015-04-18 20:35:55 +00:00
|
|
|
secrets by token, and more.
|
|
|
|
|
2017-09-13 01:48:52 +00:00
|
|
|
When any other auth method returns an identity, Vault core invokes the
|
|
|
|
token method to create a new unique token for that identity.
|
2015-04-18 20:35:55 +00:00
|
|
|
|
2017-09-13 01:48:52 +00:00
|
|
|
The token store can also be used to bypass any other auth method:
|
2015-04-18 20:35:55 +00:00
|
|
|
you can create tokens directly, as well as perform a variety of other
|
|
|
|
operations on tokens such as renewal and revocation.
|
|
|
|
|
2020-01-22 20:05:41 +00:00
|
|
|
Please see the [token concepts](/docs/concepts/tokens) page dedicated
|
2015-04-18 20:35:55 +00:00
|
|
|
to tokens.
|
|
|
|
|
|
|
|
## Authentication
|
|
|
|
|
2017-08-08 16:28:17 +00:00
|
|
|
### Via the CLI
|
2015-04-18 20:35:55 +00:00
|
|
|
|
2020-05-21 17:18:17 +00:00
|
|
|
```shell-session
|
2017-09-13 01:48:52 +00:00
|
|
|
$ vault login token=<token>
|
2015-04-18 20:35:55 +00:00
|
|
|
```
|
|
|
|
|
2017-08-08 16:28:17 +00:00
|
|
|
### Via the API
|
2015-04-18 20:35:55 +00:00
|
|
|
|
2018-10-17 14:38:15 +00:00
|
|
|
The token is set directly as a header for the HTTP API. The header should be
|
|
|
|
either `X-Vault-Token: <token>` or `Authorization: Bearer <token>`.
|
2015-04-18 20:35:55 +00:00
|
|
|
|
|
|
|
## API
|
|
|
|
|
2017-09-13 01:48:52 +00:00
|
|
|
The Token auth method has a full HTTP API. Please see the
|
2022-03-18 01:14:48 +00:00
|
|
|
[Token auth method API](/api-docs/auth/token) for more
|
2017-08-08 16:28:17 +00:00
|
|
|
details.
|