[GH-ISSUE #2384] FreeBSD: authenticate by default with DeviceCodeFlow instead of PKCE #5079

Closed
opened 2026-08-05 01:01:14 -04:00 by saavagebueno · 4 comments
Owner

Originally created by @skillcoder on GitHub (Aug 4, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/2384

Is your feature request related to a problem? Please describe.
I'm always frustrated when I need to add a new FreeBSD peer.
Currently netbird login command by default use PKCE to authenticate FreeBSD peer.
For PKCE you must copy link to your local machine and after use curl on remote host to authenticate FreeBSD peer.
The current auth process described in #1505 and it not very convenient.

Describe the solution you'd like
Instead of using PKCE to authenticate FreeBSD peer, by default netbird client on FreeBSD should offer the device auth flow for SSO.

Describe alternatives you've considered
As alternative you can use NB_SETUP_KEY env var or specify a setup key in rc.conf after we support it in FreeBSD netbird port.

Additional context
For linux we have these checks:
9a6814deff/client/internal/auth/oauth.go (L68)
69048bfd34/client/cmd/login.go (L221)

From my experience almost nobody use FreeBSD as a Desktop.
So for now I suppose we don't need to support it, better to wait for such feature request and implement support in separate PR.

Originally created by @skillcoder on GitHub (Aug 4, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/2384 **Is your feature request related to a problem? Please describe.** I'm always frustrated when I need to add a new FreeBSD peer. Currently `netbird login` command by default use PKCE to authenticate FreeBSD peer. For PKCE you must copy link to your local machine and after use curl on remote host to authenticate FreeBSD peer. The current auth process described in [#1505](https://github.com/netbirdio/netbird/issues/1505#issuecomment-2254208989) and it not very convenient. **Describe the solution you'd like** Instead of using PKCE to authenticate FreeBSD peer, by default netbird client on FreeBSD should offer the device auth flow for SSO. **Describe alternatives you've considered** As alternative you can use NB_SETUP_KEY env var or specify a setup key in `rc.conf` after we support it in FreeBSD netbird port. **Additional context** For linux we have these checks: https://github.com/netbirdio/netbird/blob/9a6814deff52b989e348c5a085156abe5b5c5769/client/internal/auth/oauth.go#L68 https://github.com/netbirdio/netbird/blob/69048bfd349d82805a9463dc86cd5ea7adefa363/client/cmd/login.go#L221 From my experience almost nobody use FreeBSD as a Desktop. So for now I suppose we don't need to support it, better to wait for such feature request and implement support in separate PR.
saavagebueno added the feature-requestfreebsd labels 2026-08-05 01:01:14 -04:00
Author
Owner

@skillcoder commented on GitHub (Aug 4, 2024):

I will create a PR

<!-- gh-comment-id:2267501634 --> @skillcoder commented on GitHub (Aug 4, 2024): I will create a PR
Author
Owner

@mlsmaycon commented on GitHub (Aug 4, 2024):

Thanks, @skillcoder, for opening the issue and for working on the PR.

<!-- gh-comment-id:2267566565 --> @mlsmaycon commented on GitHub (Aug 4, 2024): Thanks, @skillcoder, for opening the issue and for working on the PR.
Author
Owner

@avg-I commented on GitHub (Aug 26, 2024):

I am using FreeBSD as a desktop.
A change like this can break first experience for common FreeBSD users.

Please revert #2389.
I think that FreeBSD can do exactly what Linux does (check for desktop environment variables).
I do not see why that wouldn't work for you (headless,OPNSense, etc) and for regular FreeBSD desktop users.

<!-- gh-comment-id:2309992485 --> @avg-I commented on GitHub (Aug 26, 2024): I am using FreeBSD as a desktop. A change like this can break first experience for common FreeBSD users. Please revert #2389. I think that FreeBSD can do exactly what Linux does (check for desktop environment variables). I do not see why that wouldn't work for you (headless,OPNSense, etc) and for regular FreeBSD desktop users.
Author
Owner

@PizzaLovingNerd commented on GitHub (May 27, 2026):

Closing as this was addressed by #2389, and the current behavior now handles FreeBSD similarly to Linux: headless FreeBSD uses Device Code Flow by default, while FreeBSD desktop environments detected via DESKTOP_SESSION or XDG_CURRENT_DESKTOP can still use PKCE.

Cheers!

<!-- gh-comment-id:4559882075 --> @PizzaLovingNerd commented on GitHub (May 27, 2026): Closing as this was addressed by #2389, and the current behavior now handles FreeBSD similarly to Linux: headless FreeBSD uses Device Code Flow by default, while FreeBSD desktop environments detected via `DESKTOP_SESSION` or `XDG_CURRENT_DESKTOP` can still use PKCE. Cheers!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#5079