cli-device-login

command
v2.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL