Add a --device-flow flag to force Device Code Flow on CLI #6475
andreasgerner
started this conversation in
Ideas & Feature Requests
Replies: 2 comments
|
I have implemented this idea on a fork already. An approval would lead to an instant PR from my side. |
0 replies
|
any update on approving this? PRs are ready on both docs and client. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before posting
Product area
CLI
Problem or use case
Our company WAF blocks requests containing
localhostas an attack vector.As the CLI prefers PKCE authorization code flow on MacOS and Windows, the PKCE callback never completes and interactive SSO login fails.
Proposed solution
The server side already supports the OAuth 2.0 Device Authorization Grant - including with the embedded IdP (Dex), which serves both GetPKCEAuthorizationFlow and GetDeviceAuthorizationFlow. The device flow needs no localhost callback, so it would work fine in these environments.
The blocker is purely client-side flow selection:
So a desktop user has no way to opt into device flow, even though the server offers it.
--no-browser (#3608) does not help: it only suppresses the browser launch; the underlying flow is still PKCE and the localhost callback still has to fire.
Proposal: Add a CLI flag (e.g. --device-flow / --use-device-auth) to netbird login and netbird up that passes forceDeviceCodeFlow=true into NewOAuthFlow. This appears to be a small wiring change since the device-flow code path and server support already exist.
Alternatives or workarounds considered
Community impact and priority
Examples from other tools or products
No response
Security, privacy, and compatibility considerations
No response
Implementation ideas
client/cmd/login.go (illustrative)
Are you willing to help?
Yes, I can submit a PR if the approach is accepted.
Additional context
No response
All reactions