[PR #2350] Add extra auth audience field on HttpConfig for automation user to authorize via zitadel #3357

Open
opened 2025-11-20 08:05:46 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/2350

State: closed
Merged: Yes


Describe your changes

Currently in the setup that is used in getting started with zitadel script, only 2 audiences are configured when the http server checks the auth token. Those 2 are: 1. HttpConfig.AuthAudience and 2. DeviceAuthorization.ProviderConfig.Audience.

The HttpConfig authAudience is setup like this: "AuthAudience": "$NETBIRD_AUTH_CLIENT_ID"
The DeviceAuthorization.ProviderConfig.Audience is setup like this: "Audience": "$NETBIRD_AUTH_CLIENT_ID_CLI",

Therefore, any auth token that will be accepted by the api server has to have either of those 2 audiences set.

In order to provide an automation user (zitadel machine user) with a clientid/clientsecret to allow for unattended login by ansible/terraform/etc, it is not obvious how to get a token with that audience, at least I haven't figured out how.

I can only seem to create a machine user with its unique clientid which is set as the audience.

So, this addition of an extra audience field to the httpconfig is intended to allow for specifying the audience of the automation user.

If this achievable in another way, happy to know how.

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
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/2350 **State:** closed **Merged:** Yes --- ## Describe your changes Currently in the setup that is used in getting started with zitadel script, only 2 audiences are configured when the http server checks the auth token. Those 2 are: 1. HttpConfig.AuthAudience and 2. DeviceAuthorization.ProviderConfig.Audience. The HttpConfig authAudience is setup like this: "AuthAudience": "$NETBIRD_AUTH_CLIENT_ID" The DeviceAuthorization.ProviderConfig.Audience is setup like this: "Audience": "$NETBIRD_AUTH_CLIENT_ID_CLI", Therefore, any auth token that will be accepted by the api server has to have either of those 2 audiences set. In order to provide an automation user (zitadel machine user) with a clientid/clientsecret to allow for unattended login by ansible/terraform/etc, it is not obvious how to get a token with that audience, at least I haven't figured out how. I can only seem to create a machine user with its unique clientid which is set as the audience. So, this addition of an extra audience field to the httpconfig is intended to allow for specifying the audience of the automation user. If this achievable in another way, happy to know how. ## 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
saavagebueno added the pull-request label 2025-11-20 08:05:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#3357