After upgrade, JWT validation fails: "unable to get authentik token, statusCode 400" #2391

Closed
opened 2025-11-20 07:09:06 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @AblabiX on GitHub (Oct 18, 2025).

Describe the problem

After upgrading NetBird to the latest version, the management service fails to validate JWT tokens.
Authentication attempts return an error related to Authentik token validation.

2025-10-18T17:33:43Z ERRO [context: HTTP, requestID: REDACTED0] management/server/http/middleware/auth_middleware.go:69: Error when validating JWT: unable to get authentik token, statusCode 400
2025-10-18T17:33:43Z ERRO [requestID: REDACTED70, context: HTTP] shared/management/http/util/util.go:85: got a handler error: token invalid

To Reproduce

Steps to reproduce the behavior:

Upgrade NetBird to the latest release (performed on 2025-10-18).

Try to authenticate using a valid JWT token through the management API.

Observe the error in the management container logs.

Expected behavior

JWT validation should succeed, and the management service should be able to obtain a valid Authentik token.
Authentication via the management API should work normally.

Are you using NetBird Cloud?

No, this is a self-hosted NetBird setup integrated with Authentik.

NetBird version

last one

Is any other VPN software installed?

Debug output

To help us resolve the problem, please attach the following anonymized status output

This issue started immediately after the upgrade.
Before the update, JWT validation with Authentik was working correctly.
It might be related to Authentik token configuration or key mismatch after the upgrade.

Originally created by @AblabiX on GitHub (Oct 18, 2025). **Describe the problem** After upgrading NetBird to the latest version, the management service fails to validate JWT tokens. Authentication attempts return an error related to Authentik token validation. 2025-10-18T17:33:43Z ERRO [context: HTTP, requestID: REDACTED0] management/server/http/middleware/auth_middleware.go:69: Error when validating JWT: unable to get authentik token, statusCode 400 2025-10-18T17:33:43Z ERRO [requestID: REDACTED70, context: HTTP] shared/management/http/util/util.go:85: got a handler error: token invalid **To Reproduce** Steps to reproduce the behavior: Upgrade NetBird to the latest release (performed on 2025-10-18). Try to authenticate using a valid JWT token through the management API. Observe the error in the management container logs. **Expected behavior** JWT validation should succeed, and the management service should be able to obtain a valid Authentik token. Authentication via the management API should work normally. **Are you using NetBird Cloud?** No, this is a self-hosted NetBird setup integrated with Authentik. **NetBird version** last one **Is any other VPN software installed?** **Debug output** To help us resolve the problem, please attach the following anonymized status output This issue started immediately after the upgrade. Before the update, JWT validation with Authentik was working correctly. It might be related to Authentik token configuration or key mismatch after the upgrade.
saavagebueno added the triage-needed label 2025-11-20 07:09:06 -05:00
Author
Owner

@AblabiX commented on GitHub (Oct 19, 2025):

was my fault with the service account

@AblabiX commented on GitHub (Oct 19, 2025): was my fault with the service account
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2391