[GH-ISSUE #4541] [Keycloak] Do I need the realm-level api scope or aud=NETBIRD_AUTH_AUDIENCE enough? #8895

Closed
opened 2026-08-05 01:19:56 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @rismalrv on GitHub (Sep 25, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4541

Describe the problem

Clarification request: NetBird Keycloak guide creates a realm-level client scope api with an Audience mapper and links it to netbird-client.
Do I actually need the realm-level api scope, or is it enough that the JWT’s aud equals/contains NETBIRD_AUTH_AUDIENCE regardless of whether Keycloak injects it via a realm-level scope or a client-level (dedicated) mapper?

Expected behavior
NetBird accepts tokens when aud equals/contains NETBIRD_AUTH_AUDIENCE, regardless of whether the audience was added by a realm-level client scope or a client-level (dedicated) mapper.

Are you using NetBird Cloud?
No

NetBird version
v0.58.0 (self-hosted)

Is any other VPN software installed?
No.

Debug output
N/A — this is an Netbird-related oidc configuration/behavior question, no runtime error to attach.

Screenshots
N/A

Additional context
Keycloak context: You can attach an Audience protocol mapper either directly to the client (its “dedicated” client scope — mappers attached to that client) or to a realm-level client scope that you link to the client (Official docs follow this approach)

Keycloak: v26.3.4
Docs reference: https://docs.netbird.io/selfhosted/identity-providers#keycloak

Originally created by @rismalrv on GitHub (Sep 25, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4541 **Describe the problem** Clarification request: NetBird Keycloak guide creates a realm-level client scope `api` with an Audience mapper and links it to `netbird-client`. Do I actually need the realm-level `api` scope, or is it enough that the JWT’s `aud` equals/contains NETBIRD_AUTH_AUDIENCE regardless of whether Keycloak injects it via a realm-level scope or a client-level (dedicated) mapper? **Expected behavior** NetBird accepts tokens when `aud` equals/contains NETBIRD_AUTH_AUDIENCE, regardless of whether the audience was added by a realm-level client scope or a client-level (dedicated) mapper. **Are you using NetBird Cloud?** No **NetBird version** v0.58.0 (self-hosted) **Is any other VPN software installed?** No. **Debug output** N/A — this is an Netbird-related oidc configuration/behavior question, no runtime error to attach. **Screenshots** N/A **Additional context** Keycloak context: You can attach an Audience protocol mapper either directly to the client (its “dedicated” client scope — mappers attached to that client) or to a realm-level client scope that you link to the client (Official docs follow this approach) Keycloak: v26.3.4 Docs reference: https://docs.netbird.io/selfhosted/identity-providers#keycloak
saavagebueno added the triage-needed label 2026-08-05 01:19:56 -04:00
Author
Owner

@rismalrv commented on GitHub (Sep 29, 2025):

NetBird is agnostic to how Keycloak injects this audience (e.g., via a realm-level client scope with an Audience mapper, or a dedicated client-level Audience mapper). Closing the issue as the functionality is supported.

<!-- gh-comment-id:3345202970 --> @rismalrv commented on GitHub (Sep 29, 2025): NetBird is agnostic to how Keycloak injects this audience (e.g., via a realm-level client scope with an Audience mapper, or a dedicated client-level Audience mapper). Closing the issue as the functionality is supported.
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#8895