Skip to content

Commit

Permalink
add mentions of authorization header support in doc (#5478)
Browse files Browse the repository at this point in the history
  • Loading branch information
uepoch authored and chrishoffman committed Oct 17, 2018
1 parent 3cf5b63 commit 725b295
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions website/source/api/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ to have to do both depending on user settings.

Once Vault is unsealed, almost every other operation requires a _client token_.
A user may have a client token sent to them. The client token must be sent as
the `X-Vault-Token` HTTP header.
either the `X-Vault-Token` HTTP Header or as `Authorization` HTTP Header using
the `Bearer <token>` scheme.

Otherwise, a client token can be retrieved via [authentication
backends](/docs/auth/index.html).
Expand All @@ -46,7 +47,7 @@ method.

Responses from auth login methods that generate an authentication token are
sent back to the client via JSON. The resulting token should be saved on the
client or passed via the `X-Vault-Token` header for future requests.
client or passed via the `X-Vault-Token` or `Authorization` header for future requests.

## Namespaces

Expand Down
1 change: 1 addition & 0 deletions website/source/api/system/config-cors.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ $ curl \
"X-Vault-AWS-IAM-Server-ID",
"X-Vault-No-Request-Forwarding",
"X-Vault-Token",
"Authorization",
"X-Vault-Wrap-Format",
"X-Vault-Wrap-TTL",
]
Expand Down
8 changes: 4 additions & 4 deletions website/source/docs/auth/aws.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,21 +651,21 @@ $ vault write auth/aws/login role=dev-role-iam \
#### Enable AWS authentication in Vault.

```
curl -X POST -H "x-vault-token:123" "http://127.0.0.1:8200/v1/sys/auth/aws" -d '{"type":"aws"}'
curl -X POST -H "X-Vault-Token:123" "http://127.0.0.1:8200/v1/sys/auth/aws" -d '{"type":"aws"}'
```

#### Configure the credentials required to make AWS API calls.

```
curl -X POST -H "x-vault-token:123" "http://127.0.0.1:8200/v1/auth/aws/config/client" -d '{"access_key":"VKIAJBRHKH6EVTTNXDHA", "secret_key":"vCtSM8ZUEQ3mOFVlYPBQkf2sO6F/W7a5TVzrl3Oj"}'
curl -X POST -H "X-Vault-Token:123" "http://127.0.0.1:8200/v1/auth/aws/config/client" -d '{"access_key":"VKIAJBRHKH6EVTTNXDHA", "secret_key":"vCtSM8ZUEQ3mOFVlYPBQkf2sO6F/W7a5TVzrl3Oj"}'
```

#### Configure the policies on the role.

```
curl -X POST -H "x-vault-token:123" "http://127.0.0.1:8200/v1/auth/aws/role/dev-role -d '{"bound_ami_id":"ami-fce3c696","policies":"prod,dev","max_ttl":"500h"}'
curl -X POST -H "X-Vault-Token:123" "http://127.0.0.1:8200/v1/auth/aws/role/dev-role -d '{"bound_ami_id":"ami-fce3c696","policies":"prod,dev","max_ttl":"500h"}'
curl -X POST -H "x-vault-token:123" "http://127.0.0.1:8200/v1/auth/aws/role/dev-role-iam -d '{"auth_type":"iam","policies":"prod,dev","max_ttl":"500h","bound_iam_principal_arn":"arn:aws:iam::123456789012:role/MyRole"}'
curl -X POST -H "X-Vault-Token:123" "http://127.0.0.1:8200/v1/auth/aws/role/dev-role-iam -d '{"auth_type":"iam","policies":"prod,dev","max_ttl":"500h","bound_iam_principal_arn":"arn:aws:iam::123456789012:role/MyRole"}'
```

#### Perform the login operation
Expand Down
4 changes: 2 additions & 2 deletions website/source/docs/auth/token.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ $ vault login token=<token>

### Via the API

The token is set directly as a header for the HTTP API. The name
of the header should be "X-Vault-Token" and the value should be the token.
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>`.

## API

Expand Down
2 changes: 1 addition & 1 deletion website/source/guides/identity/authentication.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ This time, it should return the values you just created.
#### API call using cURL

You can now pass the `client_token` returned in [Step 4](#step4) in the
**`X-Vault-Token`** header.
**`X-Vault-Token`** or **`Authorization`** header.

**Example:**

Expand Down

0 comments on commit 725b295

Please sign in to comment.