netbirdio/netbird · error

Forbidden

Error message

Forbidden

What it means

Fires in the auth middleware when a request targets a Private domain and forwardWithTunnelPeer could not authorize the request by tunnel peer identity. Private services bypass operator-configured auth schemes and gate exclusively on the peer that established the tunnel; failing that check yields 403 Forbidden. Generic guard: the requester is not the authorized tunnel peer.

Solutions

  1. Verify the request arrives through the NetBird tunnel from a peer authorized for the private service
  2. Check the service's access policy and group membership in management for the connecting peer
  3. Ensure the client connects via the NetBird interface rather than the public interface
  4. Review middleware logs for the peer identity that failed the check
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at proxy/internal/auth/middleware.go:131 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/d7012130f526b2d8. Report an issue: GitHub.

Appendix: source

Thrown at proxy/internal/auth/middleware.go:131

		if !exists {
			next.ServeHTTP(w, r)
			return
		}

		// Set account and service IDs in captured data for access logging.
		setCapturedIDs(r, config)

		if !mw.checkIPRestrictions(w, r, config) {
			return
		}

		// Private services bypass operator schemes and gate on tunnel peer.
		if config.Private {
			if mw.forwardWithTunnelPeer(w, r, host, config, next) {
				return
			}
			http.Error(w, "Forbidden", http.StatusForbidden)
			return
		}

		// Domains with no authentication schemes pass through after IP checks.
		if len(config.Schemes) == 0 {
			next.ServeHTTP(w, r)
			return
		}

		if mw.handleOAuthCallbackError(w, r) {
			return
		}

		if mw.forwardWithSessionCookie(w, r, host, config, next) {
			return
		}

		if mw.forwardWithHeaderAuth(w, r, host, config, next) {

View on GitHub (pinned to 93e97f4bf1)