[PR #309] [MERGED] Client Login via device authorization flow #12457

Closed
opened 2026-08-05 02:05:56 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/309
Author: @mlsmaycon
Created: 5/9/2022
Status: Merged
Merged: 5/12/2022
Merged by: @mlsmaycon

Base: mainHead: client-device-authorization


📝 Commits (10+)

  • c3da0c5 Expand GetConfigResponse with DeviceAuthorizationFlow
  • ee6fee2 Remove oauth package and merge into internal
  • 990f83b Rename type to Hosted
  • aebfaee Rename methods and const to Hosted
  • 12f0720 Configure with management URL too
  • 1f1c7b3 Retrieve device auth flow info frrom management
  • b0811d9 Add menu login button
  • 1cd8336 Check Login status and fetch flow info only when config exists
  • 6a5db56 WIP: adding status StatusNeedsLogin
  • 6d31937 Removed Login button and merged func into connect

📊 Changes

26 files changed (+924 additions, -426 deletions)

View changed files

📝 client/cmd/down.go (+1 -1)
📝 client/cmd/login.go (+144 -25)
📝 client/cmd/root.go (+4 -4)
📝 client/cmd/service_controller.go (+2 -2)
📝 client/cmd/service_installer.go (+5 -0)
📝 client/cmd/status.go (+14 -8)
📝 client/cmd/up.go (+60 -40)
📝 client/internal/config.go (+82 -0)
📝 client/internal/connect.go (+10 -1)
📝 client/internal/login.go (+2 -3)
📝 client/internal/oauth.go (+63 -32)
client/internal/oauth/oauth.go (+0 -37)
client/internal/oauth/secret.go (+0 -66)
client/internal/oauth/secret_test.go (+0 -27)
📝 client/internal/oauth_test.go (+15 -15)
📝 client/internal/state.go (+4 -2)
📝 client/proto/daemon.pb.go (+267 -112)
📝 client/proto/daemon.proto (+16 -3)
📝 client/proto/daemon_grpc.pb.go (+40 -0)
📝 client/server/server.go (+144 -15)

...and 6 more files

📄 Description

The client will fetch the device authorization flow information from management and will use it to login using our hosted provider.

  • moved the OAuth package to internal as we only have one option
  • use management URL in the service configuration
  • Added SSO login to UI and CLI clients
  • Check if the client is logged in when starting UI
  • retrieve device authorization flow information from management

🔄 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/309 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 5/9/2022 **Status:** ✅ Merged **Merged:** 5/12/2022 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `client-device-authorization` --- ### 📝 Commits (10+) - [`c3da0c5`](https://github.com/netbirdio/netbird/commit/c3da0c52402f8c36ac370422774eb63d1c8cf60d) Expand GetConfigResponse with DeviceAuthorizationFlow - [`ee6fee2`](https://github.com/netbirdio/netbird/commit/ee6fee26c45cb29e5c62c50790e83f5189cadd38) Remove oauth package and merge into internal - [`990f83b`](https://github.com/netbirdio/netbird/commit/990f83b820c540ea1bb9c38cf28e772b07d0f238) Rename type to Hosted - [`aebfaee`](https://github.com/netbirdio/netbird/commit/aebfaeee6a689b5882ea5139bcb1a7cb3a53156c) Rename methods and const to Hosted - [`12f0720`](https://github.com/netbirdio/netbird/commit/12f072085c0bf16e82251a32903952a157251faa) Configure with management URL too - [`1f1c7b3`](https://github.com/netbirdio/netbird/commit/1f1c7b3eb8c2617d3f5ffc85158ac4ff881346e4) Retrieve device auth flow info frrom management - [`b0811d9`](https://github.com/netbirdio/netbird/commit/b0811d9b21ec75b39d8cad0c6f403a86ebb6dcd5) Add menu login button - [`1cd8336`](https://github.com/netbirdio/netbird/commit/1cd833671c3c9d8b0879893c3749d26f156caa92) Check Login status and fetch flow info only when config exists - [`6a5db56`](https://github.com/netbirdio/netbird/commit/6a5db5627eb6d5822a05ea672b4b43939c53018a) WIP: adding status StatusNeedsLogin - [`6d31937`](https://github.com/netbirdio/netbird/commit/6d319378e964d80e3c6c776e80a74c4eef1ff44b) Removed Login button and merged func into connect ### 📊 Changes **26 files changed** (+924 additions, -426 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/down.go` (+1 -1) 📝 `client/cmd/login.go` (+144 -25) 📝 `client/cmd/root.go` (+4 -4) 📝 `client/cmd/service_controller.go` (+2 -2) 📝 `client/cmd/service_installer.go` (+5 -0) 📝 `client/cmd/status.go` (+14 -8) 📝 `client/cmd/up.go` (+60 -40) 📝 `client/internal/config.go` (+82 -0) 📝 `client/internal/connect.go` (+10 -1) 📝 `client/internal/login.go` (+2 -3) 📝 `client/internal/oauth.go` (+63 -32) ➖ `client/internal/oauth/oauth.go` (+0 -37) ➖ `client/internal/oauth/secret.go` (+0 -66) ➖ `client/internal/oauth/secret_test.go` (+0 -27) 📝 `client/internal/oauth_test.go` (+15 -15) 📝 `client/internal/state.go` (+4 -2) 📝 `client/proto/daemon.pb.go` (+267 -112) 📝 `client/proto/daemon.proto` (+16 -3) 📝 `client/proto/daemon_grpc.pb.go` (+40 -0) 📝 `client/server/server.go` (+144 -15) _...and 6 more files_ </details> ### 📄 Description The client will fetch the device authorization flow information from management and will use it to login using our hosted provider. * moved the OAuth package to internal as we only have one option * use management URL in the service configuration * Added SSO login to UI and CLI clients * Check if the client is logged in when starting UI * retrieve device authorization flow information from management --- <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 02:05:56 -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#12457