Device flow
A tool that speaks the OAuth device flow can sign itself in to a vault server the way login does.
POST /device_authorizationwithname=<machine>, optionallyscope=vault:read, and optionallyvault=<slug>to ask for that vault. It answersdevice_code,user_code,verification_uri,verification_uri_complete,intervalandexpires_in.- The person opens
VAULT_PUBLIC_URL/device, enters the code and approves. Withoutvault=<slug>they pick a vault when approving. - Poll
POST /tokenwithgrant_type=urn:ietf:params:oauth:grant-type:device_codeand thedevice_codeeveryintervalseconds.
/token answers:
| Answer | Meaning |
|---|---|
authorization_pending |
The person has not approved yet. |
slow_down |
Polled too often. |
access_denied |
The person refused. |
expired_token |
The code ran out. |
{"access_token": "nvm_...", "token_type": "Bearer", "scope": "...", "key_name": "...", "resource": ".../mcp", "vault": "<slug>", "vault_name": "..."} |
Approved. Send the token as Authorization: Bearer. |