[PR #3159] [MERGED] [management] enable optional zitadel configuration of a PAT #19475

Open
opened 2026-08-05 05:06:04 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3159
Author: @adasauce
Created: 1/7/2025
Status: Merged
Merged: 1/14/2025
Merged by: @bcmmbaga

Base: mainHead: zitadel-pat


📝 Commits (2)

  • f6e8128 [management] enable optional zitadel configuration of a PAT for service user via the ExtraConfig fields
  • 3eee960 [management] validate both PAT and JWT configurations for zitadel

📊 Changes

2 files changed (+48 additions, -14 deletions)

View changed files

📝 management/server/idp/idp.go (+1 -0)
📝 management/server/idp/zitadel.go (+47 -14)

📄 Description

for service user via the ExtraConfig fields.

re-opening PR #2661 after pull/rebase

Describe your changes

I'm sure this one is a little spicier of a take than my last PR to merge in some extra logging. During my struggle to get the recent zitadel working with netbird, I added the ability for netbird to just use a PAT to work around it while I investigated further.

Since the JWT and PAT both use the same mechanism to pass the token in the authorization header, the existing struct for JWTToken can be used and the authentication step short-circuited by supplying a long lasting AccessToken.

My current configuration looks somewhat like this:

    "IdpManagerConfig": {
        "ManagerType": "zitadel",
        "ClientConfig": {
           ...
        },
        "ExtraConfig": {
            "ManagementEndpoint": "https://zitadel-domain/management/v1",
            "PAT": "*****************************"
        },

As zitadel operators for more than just netbird, we have PATs for multiple different project service accounts across other orgs that integrate with it, and would prefer to use a PAT to simplify our security procedures too.

I'm not sure if this is the best end state for user experience as I rushed to implement something that worked in a fire, but figured this would be a good starting place to open the conversation.

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/3159 **Author:** [@adasauce](https://github.com/adasauce) **Created:** 1/7/2025 **Status:** ✅ Merged **Merged:** 1/14/2025 **Merged by:** [@bcmmbaga](https://github.com/bcmmbaga) **Base:** `main` ← **Head:** `zitadel-pat` --- ### 📝 Commits (2) - [`f6e8128`](https://github.com/netbirdio/netbird/commit/f6e81284d449b5d3ad7e492c2c15ef059d42f8d6) [management] enable optional zitadel configuration of a PAT for service user via the ExtraConfig fields - [`3eee960`](https://github.com/netbirdio/netbird/commit/3eee96034c7272a318d4893e541a1e212713d6e5) [management] validate both PAT and JWT configurations for zitadel ### 📊 Changes **2 files changed** (+48 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `management/server/idp/idp.go` (+1 -0) 📝 `management/server/idp/zitadel.go` (+47 -14) </details> ### 📄 Description for service user via the ExtraConfig fields. re-opening PR #2661 after pull/rebase ## Describe your changes I'm sure this one is a little spicier of a take than my last PR to merge in some extra logging. During my struggle to get the recent zitadel working with netbird, I added the ability for netbird to just use a PAT to work around it while I investigated further. Since the JWT and PAT both use the same mechanism to pass the token in the authorization header, the existing struct for `JWTToken` can be used and the authentication step short-circuited by supplying a long lasting `AccessToken`. My current configuration looks somewhat like this: ```json "IdpManagerConfig": { "ManagerType": "zitadel", "ClientConfig": { ... }, "ExtraConfig": { "ManagementEndpoint": "https://zitadel-domain/management/v1", "PAT": "*****************************" }, ``` As zitadel operators for more than just netbird, we have PATs for multiple different project service accounts across other orgs that integrate with it, and would prefer to use a PAT to simplify our security procedures too. I'm not sure if this is the best end state for user experience as I rushed to implement something that worked in a fire, but figured this would be a good starting place to open the conversation. ## 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 05:06:04 -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#19475