[PR #1135] [MERGED] Improve Client Authentication #14921

Closed
opened 2026-08-05 03:06:36 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1135
Author: @bcmmbaga
Created: 9/8/2023
Status: Merged
Merged: 9/19/2023
Merged by: @bcmmbaga

Base: mainHead: fix-linux-client-auth


📝 Commits (9)

  • 23f5aee shutdown the pkce server on user cancellation
  • f244908 Refactor openURL to exclusively manage authentication flow instructions and browser launching
  • 457ab35 Refactor authentication flow initialization based on client OS
  • 20c1a63 Replace log-based Linux desktop check with process check
  • 3523fc6 Refactor PKCE Authorization Flow to improve server handling
  • f7a4d30 Merge branch 'main' into fix-linux-client-auth
  • 808c11a Merge branch 'main' into fix-linux-client-auth
  • fe222bd refactor check for linux running desktop environment
  • a2ed04a Improve server shutdown handling and encapsulate handlers with new server multiplexer

📊 Changes

4 files changed (+91 additions, -111 deletions)

View changed files

📝 client/cmd/login.go (+6 -47)
📝 client/internal/auth/oauth.go (+28 -10)
📝 client/internal/auth/pkce_flow.go (+51 -54)
📝 client/internal/auth/util.go (+6 -0)

📄 Description

Describe your changes

  • Enable authentication via the device code flow for Linux devices without a desktop environment, if configured prior to using setup keys
  • Enhance the closure of the PKCE server upon authentication completion or user cancellation with context
  • Fix EOF error occurring during PKCE authentication after the login has expired

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/1135 **Author:** [@bcmmbaga](https://github.com/bcmmbaga) **Created:** 9/8/2023 **Status:** ✅ Merged **Merged:** 9/19/2023 **Merged by:** [@bcmmbaga](https://github.com/bcmmbaga) **Base:** `main` ← **Head:** `fix-linux-client-auth` --- ### 📝 Commits (9) - [`23f5aee`](https://github.com/netbirdio/netbird/commit/23f5aee0631879845fe96c22874b4939a510e9ab) shutdown the pkce server on user cancellation - [`f244908`](https://github.com/netbirdio/netbird/commit/f24490812676da25efe6079d637622d26b094d9b) Refactor openURL to exclusively manage authentication flow instructions and browser launching - [`457ab35`](https://github.com/netbirdio/netbird/commit/457ab358181c9b1e5831055e385a77aba930c074) Refactor authentication flow initialization based on client OS - [`20c1a63`](https://github.com/netbirdio/netbird/commit/20c1a6368ec9367ba5cd467093ff6cf7a5507f50) Replace log-based Linux desktop check with process check - [`3523fc6`](https://github.com/netbirdio/netbird/commit/3523fc68d8246853ee8f9e9a0f126b2b1f18dfe2) Refactor PKCE Authorization Flow to improve server handling - [`f7a4d30`](https://github.com/netbirdio/netbird/commit/f7a4d30f133ea4893ff70ced7cb1e566320cb96e) Merge branch 'main' into fix-linux-client-auth - [`808c11a`](https://github.com/netbirdio/netbird/commit/808c11a731e5539ac6289c39e4e4215ba10d1a63) Merge branch 'main' into fix-linux-client-auth - [`fe222bd`](https://github.com/netbirdio/netbird/commit/fe222bd90ce2a07fb048cf280fde765e01dd6f5b) refactor check for linux running desktop environment - [`a2ed04a`](https://github.com/netbirdio/netbird/commit/a2ed04a787b05ad6e393ec2f7679d399b24f1801) Improve server shutdown handling and encapsulate handlers with new server multiplexer ### 📊 Changes **4 files changed** (+91 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/login.go` (+6 -47) 📝 `client/internal/auth/oauth.go` (+28 -10) 📝 `client/internal/auth/pkce_flow.go` (+51 -54) 📝 `client/internal/auth/util.go` (+6 -0) </details> ### 📄 Description ## Describe your changes - Enable authentication via the device code flow for Linux devices without a desktop environment, if configured prior to using setup keys - Enhance the closure of the PKCE server upon authentication completion or user cancellation with context - Fix EOF error occurring during PKCE authentication after the login has expired ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:06:36 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#14921