mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-17 03:57:01 +02:00
Update github login output in the docs
This commit is contained in:
parent
baece44ded
commit
174aa4adb1
@ -10,10 +10,9 @@ description: |-
|
|||||||
|
|
||||||
Name: `github`
|
Name: `github`
|
||||||
|
|
||||||
The GitHub auth backend can be used to authenticate with Vault using
|
The GitHub auth backend can be used to authenticate with Vault using a GitHub
|
||||||
a GitHub personal access token.
|
personal access token. This method of authentication is most useful for humans:
|
||||||
This method of authentication is most useful for humans: operators or
|
operators or developers using Vault directly via the CLI.
|
||||||
developers using Vault directly via the CLI.
|
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
@ -42,23 +41,27 @@ The response will be in JSON. For example:
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{
|
{
|
||||||
"lease_id": "",
|
|
||||||
"renewable": false,
|
|
||||||
"lease_duration": 0,
|
|
||||||
"data": null,
|
|
||||||
"warnings": null,
|
|
||||||
"auth": {
|
"auth": {
|
||||||
"client_token": "c4f280f6-fdb2-18eb-89d3-589e2e834cdb",
|
"renewable": true,
|
||||||
"policies": [
|
"lease_duration": 2764800,
|
||||||
"admins"
|
|
||||||
],
|
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"org": "test_org",
|
"username": "vishalnayak",
|
||||||
"username": "rajanadar",
|
"org": "hashicorp"
|
||||||
},
|
},
|
||||||
"lease_duration": 0,
|
"policies": [
|
||||||
"renewable": false
|
"default",
|
||||||
}
|
"dev-policy"
|
||||||
|
],
|
||||||
|
"accessor": "f93c4b2d-18b6-2b50-7a32-0fecf88237b8",
|
||||||
|
"client_token": "1977fceb-3bfa-6c71-4d1f-b64af98ac018"
|
||||||
|
},
|
||||||
|
"warnings": null,
|
||||||
|
"wrap_info": null,
|
||||||
|
"data": null,
|
||||||
|
"lease_duration": 0,
|
||||||
|
"renewable": false,
|
||||||
|
"lease_id": "",
|
||||||
|
"request_id": "3c346f3b-e089-39ab-a953-a349f2284e3c"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -109,21 +112,27 @@ you will need to include it as: `some-amazing-team`.
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ vault write auth/github/map/teams/admins value=admins
|
$ vault write auth/github/map/teams/dev value=dev-policy
|
||||||
Success! Data written to: auth/github/map/teams/admins
|
Success! Data written to: auth/github/map/teams/dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The above would make anyone in the "admins" team receive tokens with the policy `admins`.
|
The above would make anyone in the `dev` team receive tokens with the policy
|
||||||
|
`dev-policy`.
|
||||||
|
|
||||||
You can then auth with a user that is a member of the "admins" team using a Personal Access Token with the `read:org` scope.
|
You can then auth with a user that is a member of the `dev` team using a
|
||||||
|
Personal Access Token with the `read:org` scope.
|
||||||
|
|
||||||
GitHub token can also be supplied from the env variable `VAULT_AUTH_GITHUB_TOKEN`.
|
GitHub token can also be supplied from the env variable `VAULT_AUTH_GITHUB_TOKEN`.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ vault auth -method=github token=000000905b381e723b3d6a7d52f148a5d43c4b45
|
$ vault auth -method=github token=000000905b381e723b3d6a7d52f148a5d43c4b45
|
||||||
Successfully authenticated! The policies that are associated
|
Successfully authenticated! You are now logged in.
|
||||||
with this token are listed below:
|
The token below is already saved in the session. You do not
|
||||||
|
need to "vault auth" again with the token.
|
||||||
admins
|
token: 0d9ab511-bc25-4fb6-a58b-94ce12b8da9c
|
||||||
|
token_duration: 2764800
|
||||||
|
token_policies: [default dev-policy]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Clients can use this token to perform an allowed set of operations on all the
|
||||||
|
paths contained by the policy set.
|
||||||
|
Loading…
Reference in New Issue
Block a user