[GH-ISSUE #452] ERR_UNAUTHORIZED Request failed with status code 401 #659

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

Originally created by @dcshoes23 on GitHub (Sep 6, 2022).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/452

I have selfhosted netbird v0.9.0 using Authentik as my identity provider.

I am able to login using Authentik and I seee the following error in the UI:
image

I see two problems in the Chrome debug console.

  1. Calls to https://auth.mydomain.com/application/o/userinfo/ fail due to a CORS error:
    Access to fetch at 'https://auth.mydomain.com/application/o/userinfo/' from origin 'https://nb.mydomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

NOTE: the call to https://auth.mydomain.com/application/o/token/ works fine which I see is called by xhr.ts:88 vs the failing call which is directly from oidc.ts:160

  1. Any web calls to the management service on :33073 are returning 401 unauthorized with the following response: The token isn't valid
Originally created by @dcshoes23 on GitHub (Sep 6, 2022). Original GitHub issue: https://github.com/netbirdio/netbird/issues/452 I have selfhosted netbird v0.9.0 using Authentik as my identity provider. I am able to login using Authentik and I seee the following error in the UI: ![image](https://user-images.githubusercontent.com/4748680/188726341-3a945afa-db53-4416-926a-b79a3a87a027.png) I see two problems in the Chrome debug console. 1. Calls to `https://auth.mydomain.com/application/o/userinfo/` fail due to a CORS error: `Access to fetch at 'https://auth.mydomain.com/application/o/userinfo/' from origin 'https://nb.mydomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.` NOTE: the call to `https://auth.mydomain.com/application/o/token/` works fine which I see is called by `xhr.ts:88` vs the failing call which is directly from `oidc.ts:160` 2. Any web calls to the management service on :33073 are returning 401 unauthorized with the following response: `The token isn't valid`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#659