[GH-ISSUE #5381] Authentik SSO Client_ID error with reverse proxy #11343

Closed
opened 2026-08-05 01:29:22 -04:00 by saavagebueno · 4 comments
Owner

Originally created by @SamFusco on GitHub (Feb 18, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5381

Describe the problem

Getting a client_id error when trying to authenticate via SSO authentication on the new reverse proxy when I am using it with my self hosted instance of Authentik. I still use Authentik for SSO/IdP to authenticate to Netbird and that works perfectly fine.

I did install Netbird a while ago and had setup the instance using the older method (configured IdP via the configure.sh script).

I tried following this migration guide, I think I covered everything but I still seem to be getting the same issue.

To Reproduce

Steps to reproduce the behavior:

  1. Setup a brand new app/service in the reverse proxy
  2. Turn on SSO protection
  3. Enable the SSO for All Users
  4. See error

Expected behavior

To be presented with the Authentik Login when trying to access one of my services behind the Netbird Reverse proxy.

Are you using NetBird Cloud?

Self-hosted

NetBird version

v0.65.2

Is any other VPN software installed?

No.

Screenshots

Image

If applicable, add screenshots to help explain your problem.

Additional context
Proxy

services:
    proxy:
        image: netbirdio/reverse-proxy:0.65.2
        container_name: netbird-proxy
        extra_hosts:
            - netbird.mydomain.com:172.20.0.2
        restart: unless-stopped
        networks:
            - traefik
        dns:
            - 1.1.1.1
            - 1.0.0.1
        depends_on:
            - management
        env_file:
            - ./proxy.env
        volumes:
            - netbird-proxy-certs:/certs
        labels:
            - traefik.enable=true
            - traefik.tcp.routers.proxy-passthrough.entrypoints=websecure
            - traefik.tcp.routers.proxy-passthrough.rule=HostSNI(`*`)
            - traefik.tcp.routers.proxy-passthrough.tls.passthrough=true
            - traefik.tcp.routers.proxy-passthrough.service=proxy-tls
            - traefik.tcp.routers.proxy-passthrough.priority=1
            - traefik.tcp.services.proxy-tls.loadbalancer.server.port=8443
        logging:
            driver: "json-file"
            options:
                max-size: "500m"
                max-file: "2"

volumes:
    netbird-proxy-certs:

networks:
    traefik:
        external: true

proxy.env

NB_PROXY_DOMAIN=proxy.mydomain.com
NB_PROXY_TOKEN=nbx_afBW.......457bv6dnd
NB_PROXY_MANAGEMENT_ADDRESS=https://netbird.mydomain.com:443
NB_PROXY_ADDRESS=:8443
NB_PROXY_ACME_CERTIFICATES=true
NB_PROXY_ACME_CHALLENGE_TYPE=tls-alpn-01
NB_PROXY_CERTIFICATE_DIRECTORY=/certs
NB_PROXY_DEBUG_LOGS=true
NB_PROXY_OIDC_CLIENT_ID=9AM..............76db
NB_PROXY_OIDC_ENDPOINT=https://auth.mydomain.com/application/o/netbird
NB_PROXY_OIDC_SCOPES=openid,profile,email

Authentik Logs

{"event":"No providers assigned to this outpost, check outpost configuration in authentik","level":"warning","logger":"authentik.outpost.proxyv2","timestamp":"2026-02-18T21:48:25+10:30"}
{"auth_via": "secret_key", "domain_url": "0.0.0.0", "event": "/api/v3/outposts/instances/", "host": "0.0.0.0:9000", "level": "info", "logger": "authentik.asgi", "method": "GET", "pid": 335940, "remote": "127.0.0.1", "request_id": "<request_id>", "runtime": 69, "schema_name": "public", "scheme": "http", "status": 200, "timestamp": "2026-02-18T21:48:25.193303", "user": "ak-outpost-<outpost_id>", "user_agent": "goauthentik.io/outpost/2025.12.4"}
{"error":"context canceled","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2026-02-18T21:50:20+10:30"}

Netbird Proxy Logs

netbird-proxy | 2026-02-18T11:15:30Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:15:30Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:15:34Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type
netbird-proxy | 2026-02-18T11:15:35Z DEBG proxy/internal/accesslog/middleware.go:27: request: request_id=<request_id_1> method=HEAD host=testmyapp.example.com path=/
netbird-proxy | 2026-02-18T11:15:35Z DEBG proxy/internal/auth/middleware.go:95: checking authentication for host: testmyapp.example.com, exists: true
netbird-proxy | 2026-02-18T11:15:36Z WARN [scheme: oidc] proxy/internal/auth/middleware.go:182: authentication infrastructure error: get OIDC URL: rpc error: code = Canceled desc = context canceled
netbird-proxy | 2026-02-18T11:15:36Z DEBG proxy/internal/accesslog/middleware.go:70: response: request_id=<request_id_1> method=HEAD host=testmyapp.example.com path=/ status=502 duration=508ms source=172.16.0.1 origin=auth service=<service_id> account=<account_id>
netbird-proxy | 2026-02-18T11:16:30Z DEBG proxy/internal/accesslog/middleware.go:27: request: request_id=<request_id_2> method=HEAD host=testmyapp.example.com path=/
netbird-proxy | 2026-02-18T11:16:30Z DEBG proxy/internal/auth/middleware.go:95: checking authentication for host: testmyapp.example.com, exists: true
netbird-proxy | 2026-02-18T11:16:30Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:16:30Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:16:31Z DEBG proxy/internal/accesslog/middleware.go:70: response: request_id=<request_id_2> method=HEAD host=testmyapp.example.com path=/ status=401 duration=664ms source=172.16.0.1 origin=auth service=<service_id> account=<account_id>
netbird-proxy | 2026-02-18T11:16:33Z WARN client/internal/peer/guard/ice_monitor.go:65: Failed to check ICE changes: wait for gathering timed out
netbird-proxy | 2026-02-18T11:16:40Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type
netbird-proxy | 2026-02-18T11:17:31Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:17:31Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR
netbird-proxy | 2026-02-18T11:17:44Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type

Also worth noting my Redirect URIs that I have configured in Authentik for my Netbird Provider:

strict: https://netbird.mydomain.com
regex: https://netbird.mydomain.com/.*
strict: http://localhost:53000
strict: https://netbird.mydomain.com/api/reverse-proxy/callback

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @SamFusco on GitHub (Feb 18, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5381 **Describe the problem** Getting a client_id error when trying to authenticate via SSO authentication on the new reverse proxy when I am using it with my self hosted instance of Authentik. I still use Authentik for SSO/IdP to authenticate to Netbird and that works perfectly fine. I did install Netbird a while ago and had setup the instance using the older method (configured IdP via the `configure.sh` script). I tried following [this](https://docs.netbird.io/selfhosted/migration/enable-reverse-proxy) migration guide, I think I covered everything but I still seem to be getting the same issue. **To Reproduce** Steps to reproduce the behavior: 1. Setup a brand new app/service in the reverse proxy 2. Turn on SSO protection 3. Enable the SSO for `All Users` 4. See error **Expected behavior** To be presented with the Authentik Login when trying to access one of my services behind the Netbird Reverse proxy. **Are you using NetBird Cloud?** Self-hosted **NetBird version** `v0.65.2` **Is any other VPN software installed?** No. **Screenshots** <img width="573" height="469" alt="Image" src="https://github.com/user-attachments/assets/b9352a91-53da-47d4-9e01-46e80b200818" /> If applicable, add screenshots to help explain your problem. **Additional context** ***Proxy*** ```yaml services: proxy: image: netbirdio/reverse-proxy:0.65.2 container_name: netbird-proxy extra_hosts: - netbird.mydomain.com:172.20.0.2 restart: unless-stopped networks: - traefik dns: - 1.1.1.1 - 1.0.0.1 depends_on: - management env_file: - ./proxy.env volumes: - netbird-proxy-certs:/certs labels: - traefik.enable=true - traefik.tcp.routers.proxy-passthrough.entrypoints=websecure - traefik.tcp.routers.proxy-passthrough.rule=HostSNI(`*`) - traefik.tcp.routers.proxy-passthrough.tls.passthrough=true - traefik.tcp.routers.proxy-passthrough.service=proxy-tls - traefik.tcp.routers.proxy-passthrough.priority=1 - traefik.tcp.services.proxy-tls.loadbalancer.server.port=8443 logging: driver: "json-file" options: max-size: "500m" max-file: "2" volumes: netbird-proxy-certs: networks: traefik: external: true ``` ***`proxy.env`*** ``` NB_PROXY_DOMAIN=proxy.mydomain.com NB_PROXY_TOKEN=nbx_afBW.......457bv6dnd NB_PROXY_MANAGEMENT_ADDRESS=https://netbird.mydomain.com:443 NB_PROXY_ADDRESS=:8443 NB_PROXY_ACME_CERTIFICATES=true NB_PROXY_ACME_CHALLENGE_TYPE=tls-alpn-01 NB_PROXY_CERTIFICATE_DIRECTORY=/certs NB_PROXY_DEBUG_LOGS=true NB_PROXY_OIDC_CLIENT_ID=9AM..............76db NB_PROXY_OIDC_ENDPOINT=https://auth.mydomain.com/application/o/netbird NB_PROXY_OIDC_SCOPES=openid,profile,email ``` ***Authentik Logs*** ``` {"event":"No providers assigned to this outpost, check outpost configuration in authentik","level":"warning","logger":"authentik.outpost.proxyv2","timestamp":"2026-02-18T21:48:25+10:30"} {"auth_via": "secret_key", "domain_url": "0.0.0.0", "event": "/api/v3/outposts/instances/", "host": "0.0.0.0:9000", "level": "info", "logger": "authentik.asgi", "method": "GET", "pid": 335940, "remote": "127.0.0.1", "request_id": "<request_id>", "runtime": 69, "schema_name": "public", "scheme": "http", "status": 200, "timestamp": "2026-02-18T21:48:25.193303", "user": "ak-outpost-<outpost_id>", "user_agent": "goauthentik.io/outpost/2025.12.4"} {"error":"context canceled","event":"failed to proxy to backend","level":"warning","logger":"authentik.router","timestamp":"2026-02-18T21:50:20+10:30"} ``` ***Netbird Proxy Logs*** ``` netbird-proxy | 2026-02-18T11:15:30Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:15:30Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:15:34Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type netbird-proxy | 2026-02-18T11:15:35Z DEBG proxy/internal/accesslog/middleware.go:27: request: request_id=<request_id_1> method=HEAD host=testmyapp.example.com path=/ netbird-proxy | 2026-02-18T11:15:35Z DEBG proxy/internal/auth/middleware.go:95: checking authentication for host: testmyapp.example.com, exists: true netbird-proxy | 2026-02-18T11:15:36Z WARN [scheme: oidc] proxy/internal/auth/middleware.go:182: authentication infrastructure error: get OIDC URL: rpc error: code = Canceled desc = context canceled netbird-proxy | 2026-02-18T11:15:36Z DEBG proxy/internal/accesslog/middleware.go:70: response: request_id=<request_id_1> method=HEAD host=testmyapp.example.com path=/ status=502 duration=508ms source=172.16.0.1 origin=auth service=<service_id> account=<account_id> netbird-proxy | 2026-02-18T11:16:30Z DEBG proxy/internal/accesslog/middleware.go:27: request: request_id=<request_id_2> method=HEAD host=testmyapp.example.com path=/ netbird-proxy | 2026-02-18T11:16:30Z DEBG proxy/internal/auth/middleware.go:95: checking authentication for host: testmyapp.example.com, exists: true netbird-proxy | 2026-02-18T11:16:30Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:16:30Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:16:31Z DEBG proxy/internal/accesslog/middleware.go:70: response: request_id=<request_id_2> method=HEAD host=testmyapp.example.com path=/ status=401 duration=664ms source=172.16.0.1 origin=auth service=<service_id> account=<account_id> netbird-proxy | 2026-02-18T11:16:33Z WARN client/internal/peer/guard/ice_monitor.go:65: Failed to check ICE changes: wait for gathering timed out netbird-proxy | 2026-02-18T11:16:40Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type netbird-proxy | 2026-02-18T11:17:31Z ERRO shared/signal/client/grpc.go:416: Stream receive error: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:17:31Z WARN shared/signal/client/grpc.go:176: disconnected from the Signal service but will retry silently. Reason: rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR netbird-proxy | 2026-02-18T11:17:44Z WARN shared/management/client/grpc.go:202: disconnected from the Management service but will retry silently. Reason: rpc error: code = Unavailable desc = unexpected HTTP status code received from server: 504 (Gateway Timeout); malformed header: missing HTTP content-type ``` Also worth noting my Redirect URIs that I have configured in Authentik for my Netbird Provider: ``` strict: https://netbird.mydomain.com regex: https://netbird.mydomain.com/.* strict: http://localhost:53000 strict: https://netbird.mydomain.com/api/reverse-proxy/callback ``` **Have you tried these troubleshooting steps?** - [x] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird client - [x] Disabled other VPN software - [x] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 01:29:22 -04:00
Author
Owner

@SuperKali commented on GitHub (Feb 18, 2026):

Same issue with Zitadel #5380

<!-- gh-comment-id:3920336998 --> @SuperKali commented on GitHub (Feb 18, 2026): Same issue with Zitadel #5380
Author
Owner

@marcportabellaclotet-mt commented on GitHub (Feb 18, 2026):

You have to add AuthClientID key in httpconfig:

"
....
"AuthCallbackURL": "https://your-netbird-domain/api/reverse-proxy/callback",
"AuthClientID": "xxx"
...
<!-- gh-comment-id:3921502372 --> @marcportabellaclotet-mt commented on GitHub (Feb 18, 2026): You have to add AuthClientID key in httpconfig: ``` " .... "AuthCallbackURL": "https://your-netbird-domain/api/reverse-proxy/callback", "AuthClientID": "xxx" ... ```
Author
Owner

@SamFusco commented on GitHub (Feb 18, 2026):

@marcportabellaclotet-mt

I didn't mention in my initial comment but I did already have this set in my management.json:

"AuthCallbackURL": "https://netbird.mydomain.com/api/reverse-proxy/callback"
<!-- gh-comment-id:3923399716 --> @SamFusco commented on GitHub (Feb 18, 2026): @marcportabellaclotet-mt I didn't mention in my initial comment but I did already have this set in my `management.json`: ``` "AuthCallbackURL": "https://netbird.mydomain.com/api/reverse-proxy/callback" ```
Author
Owner

@SamFusco commented on GitHub (Feb 18, 2026):

I'm an idiot :D I forgot the client ID in the management.json.

All working now thanks @marcportabellaclotet-mt

<!-- gh-comment-id:3923676992 --> @SamFusco commented on GitHub (Feb 18, 2026): I'm an idiot :D I forgot the client ID in the `management.json`. All working now thanks @marcportabellaclotet-mt
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#11343