FreeBSD: authenticate by default with DeviceCodeFlow instead of PKCE
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: 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.
I will create a PR
Thanks, @skillcoder, for opening the issue and for working on the PR.
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.