netbird/client/internal
Bethuel Mmbaga 8febab4076
Improve Client Authentication (#1135)
* shutdown the pkce server on user cancellation

* Refactor openURL to exclusively manage authentication flow instructions and browser launching

* Refactor authentication flow initialization based on client OS

The NewOAuthFlow method now first checks the operating system and if it is a non-desktop Linux, it opts for Device Code Flow. PKCEFlow is tried first and if it fails, then it falls back on Device Code Flow. If both unsuccessful, the authentication process halts and error messages have been updated to provide more helpful feedback for troubleshooting authentication errors

* Replace log-based Linux desktop check with process check

To verify if a Linux OS is running a desktop environment in the Authentication utility, the log-based method that checks the XDG_CURRENT_DESKTOP env has been replaced with a method that checks directly if either X or Wayland display server processes are running. This method is more reliable as it directly checks for the display server process rather than relying on an environment variable that may not be set in all desktop environments.

* Refactor PKCE Authorization Flow to improve server handling

* refactor check for linux running desktop environment

* Improve server shutdown handling and encapsulate handlers with new server multiplexer

The changes enhance the way the server shuts down by specifying a context with timeout of 5 seconds, adding a safeguard to ensure the server halts even on potential hanging requests. Also, the server's root handler is now encapsulated within a new ServeMux instance, to support multiple registrations of a path
2023-09-19 19:06:18 +03:00
..
acl Fix Android build (#1142) 2023-09-13 17:36:24 +02:00
auth Improve Client Authentication (#1135) 2023-09-19 19:06:18 +03:00
checkfw Fix Android build (#1142) 2023-09-13 17:36:24 +02:00
dns DNS forwarder and common ebpf loader (#1083) 2023-09-05 21:14:02 +02:00
ebpf DNS forwarder and common ebpf loader (#1083) 2023-09-05 21:14:02 +02:00
peer Fix/always on boot (#1062) 2023-08-11 11:51:39 +02:00
routemanager Add default firewall rule to allow netbird traffic (#1056) 2023-09-05 21:07:32 +02:00
stdnet Routemgr error handling (#1073) 2023-08-12 11:42:36 +02:00
templates Add html screen for pkce flow (#1034) 2023-07-28 18:10:12 +02:00
wgproxy Set not found ebpf log to Info (#1134) 2023-09-08 18:24:19 +02:00
config_test.go Update GitHub Actions and Enhance golangci-lint (#1075) 2023-09-04 17:03:44 +02:00
config.go Fix pre-shared key not persistent (#1011) 2023-07-13 10:49:15 +02:00
connect.go Fix/always on boot (#1062) 2023-08-11 11:51:39 +02:00
device_auth.go Add PKCE authorization flow (#1012) 2023-07-27 11:31:07 +02:00
engine_stdnet_android.go Add route management for Android interface (#801) 2023-04-17 11:15:37 +02:00
engine_stdnet.go Bind implementation (#779) 2023-04-13 17:00:01 +02:00
engine_test.go Update GitHub Actions and Enhance golangci-lint (#1075) 2023-09-04 17:03:44 +02:00
engine.go Update GitHub Actions and Enhance golangci-lint (#1075) 2023-09-04 17:03:44 +02:00
login.go Mobile (#735) 2023-03-17 10:37:27 +01:00
mobile_dependency.go Feature/permanent dns (#967) 2023-07-14 21:56:22 +02:00
pkce_auth.go Add PKCE authorization flow (#1012) 2023-07-27 11:31:07 +02:00
state.go Client Login via device authorization flow (#309) 2022-05-12 11:17:24 +02:00