Skip to content

AuthProxy

The Cratis Stack

A gateway for the edges of your app

Every application eventually grows the same crop of edge concerns: who is this user, which tenant are they in, where does this request route, and how do you onboard someone who has been invited but doesn’t have an account yet. AuthProxy is a small .NET gateway that owns those edges — so each of your services can assume the request is already authenticated, already scoped to a tenant, and already enriched with identity.

Without a gateway, every service re-implements the same boilerplate: an OpenID Connect handshake, tenant resolution from the host or a claim, a call to fetch the user’s profile, the invite-acceptance flow. It’s repetitive, it drifts between services, and it’s exactly the kind of code you don’t want copy-pasted across a fleet.

AuthProxy is a reverse proxy (built on YARP) that you put in front of your backend and frontend services. It authenticates the request, resolves the tenant, enriches the identity, and then forwards the request to your service — with the tenant and identity attached as headers. Your services trust the proxy and read those headers.

/api/** + Tenant-ID + identity

/**

AuthProxy

Authenticate

(OIDC / JWT Bearer)

Resolve tenant

Enrich identity

(/.cratis/me)

Browser / client

Backend service

Frontend SPA

There’s no code to write — AuthProxy is configured entirely through the Cratis:AuthProxy section of appsettings.json and runs as a container in front of your services. Each page under Configuration takes one edge concern and walks through how AuthProxy handles it and how you configure it.

Start by putting the proxy in front of a service — the configuration reference covers the full Cratis:AuthProxy shape.