dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Auth endpoint returns 404 on successful login

Open legalgig opened this issue 1 year ago • 2 comments

Describe the problem

After implementation of custom error pages into ingress controller (Traefik with error middleware) I've noticed that /auth endpoint returns code 404 to the browser even though the auth has succeeded. This error code breaks the error handling implemented by reverse proxies because it forwards the traffic to the container managing 400-599 error codes.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy the dashboard with Zitadel auth behind traefik reverse proxy
  2. Open up the Netbird dashboard
  3. Login into Zitadel
  4. Login should succeed but /auth endpoint will return 404 error code

Expected behavior

auth endpoint should respond with non error HTTP status code

Are you using NetBird Cloud?

No

NetBird version

Dashboard: v2.4.0 Netbird: v0.28.4

NetBird status -d output:

/

Screenshots

image

Additional context

Not sure if it's relevant but I'm using different domains for Netbird (nb.domain.com) and Netbird dashboard (nb.int.domain.com)

Dashboard environment variables:

NETBIRD_MGMT_API_ENDPOINT: "https://nb.domain.com"
NETBIRD_MGMT_GRPC_API_ENDPOINT: "https://nb.domain.com"
AUTH_AUTHORITY: https://auth.domain.com
AUTH_AUDIENCE: "client_id"
AUTH_CLIENT_ID: "client_id"
USE_AUTH0: "false"
AUTH_SUPPORTED_SCOPES: "openid profile email offline_access"
AUTH_REDIRECT_URI: "/auth"
AUTH_SILENT_REDIRECT_URI: "/silent-auth"
NETBIRD_TOKEN_SOURCE: idToken

legalgig avatar Jul 04 '24 19:07 legalgig

Thanks for reporting the issue @legalgig. I can confirm the issue and we will work on a fix for it; however, while testing, that is not stopping the authentication from proceeding. Can you confirm if your authentication fails because of this error?

mlsmaycon avatar Jul 04 '24 20:07 mlsmaycon

Authentication fails only when the error handling middleware is enabled, as soon as I disable that middleware it's working just fine.

legalgig avatar Jul 05 '24 08:07 legalgig