CLI Authentication, the Right Way
Summary
The article analyzes CLI authentication flows, explains why loopback-based OAuth redirects fail when no browser is available, and advocates the OAuth 2.0 Device Authorization Grant for device/CLI usage. It details how the device flow works, how providers handle token polling, potential phishing risks, and practical implementation recommendations for secure CLI authentication.