Documentation
¶
Overview ¶
Command cli-device-login signs a command-line tool in with the OAuth 2.0 device authorization grant (RFC 8628). It needs no browser on the machine running the CLI: it prints a short code and a URL, the user approves on any device, and the CLI polls until it receives tokens.
Try it against the bundled demo server:
go run ./examples/cli-device-login/server # prints the exact command below
go run ./examples/cli-device-login -issuer http://127.0.0.1:8080 \
-client-id <printed id> -scope profile -resource http://127.0.0.1:8080/api
Only the standard library is used, so the file can be copied into a CLI as is. Human-readable progress goes to stderr; with -json the token response is written to stdout so it can be piped.
Directories
¶
| Path | Synopsis |
|---|---|
|
Command server is a self-contained demo authorization server for the cli-device-login example: in-memory storage, the RFC 8628 device grant enabled, and a bare sign-in page so the verification flow works end to end in a browser.
|
Command server is a self-contained demo authorization server for the cli-device-login example: in-memory storage, the RFC 8628 device grant enabled, and a bare sign-in page so the verification flow works end to end in a browser. |