OAuth2 Proxy Alternative: Sign-in Without Running the Proxy Yourself
Published on November 27, 2026   •   14 min read

OAuth2 Proxy Alternative: Sign-in Without Running the Proxy Yourself

Jarek CeborskiJarek Ceborski

People look for an OAuth2 Proxy alternative when the proxy does its job but running it doesn't suit them. With OAuth2 Proxy, a public port on your server answers with a TLS certificate you provide, you apply each security release, and the app trusts plain headers from the proxy. LocalCan Access is a hosted alternative for apps with no SSO of their own: people sign in with Google, Microsoft, GitHub or your own OIDC provider before a request reaches the app, and on your server you run one connector that makes only outbound connections. OAuth2 Proxy stays open source and costs nothing, which a hosted gate can't match. I ran both on November 27, 2026 with the same test user and the same app, and recorded what each one put on the server and what the app received.

How do OAuth2 Proxy and LocalCan Access compare?

OAuth2 Proxy is "a reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others)" (OAuth2 Proxy's docs↗). It runs in front of the app as the proxy itself, or behind nginx, which asks its /oauth2/auth endpoint about each request (OAuth2 Proxy endpoints↗). Access does the same job from LocalCan's servers: one CNAME record points the app's hostname at LocalCan, and a small connector next to the app holds the only connection to LocalCan (quick start). Other self-run auth proxies follow OAuth2 Proxy's pattern, and self-hosted SSO: your own provider, a proxy or a hosted gate compares the routes.

OAuth2 Proxy 7.15LocalCan Access (Preview)
Where it runsOn your server: a binary, a container image for six CPU architectures, or Kubernetes manifestsOn LocalCan's servers. The connector runs next to the app, on Linux with Docker, Docker Compose or systemd
Reachable from the internetIts port, or its reverse proxy's (443 in production), at the address your DNS record points toThe app's hostname, at LocalCan. The connector opens no listening TCP port
TLS certificateCertificate files you supply, or a reverse proxy in front that ends TLSLocalCan gets one from Let's Encrypt once the CNAME resolves and the connector is connected
Updates you applyEvery OAuth2 Proxy release: 12 between November 8, 2025 and November 5, 2026The connector, which doesn't update itself. The rest runs on LocalCan's servers
Sign-in providersGoogle, GitHub, GitLab, Microsoft Entra ID, Keycloak, a generic OpenID Connect provider and moreGoogle, Microsoft, GitHub, or your own OIDC provider
Who gets inEmail domains, a file of email addresses, groupsExact emails, a Google Workspace domain, a Microsoft tenant ID, groups from your own provider, and a block list
What the app receivesX-Forwarded-User and X-Forwarded-Email as plain headers. With --pass-authorization-header and an OIDC provider, the provider's signed ID tokenA JWT signed with your team's key on requests from a signed-in session, valid 10 minutes at most
Webhooks and scriptsskip_auth_routes, and bearer tokens it can verifyPublic paths and service tokens
Ending a session/oauth2/sign_out clears its session cookie in the browser that opens itBlock a person or sign them out: their sessions end within 2 minutes
Sign-in recordsIts own log output (--auth-logging)An access log in the dashboard, kept 90 days
Setup lives inA config file or flags, which you can keep in gitThe dashboard
Third party in the pathNone: your server and your providerLocalCan's servers
PriceNone, MIT licenceFrom $29 a month for 3 apps, priced per app, with unlimited viewers under fair use

Prices checked November 2026. The OAuth2 Proxy column comes from its installation page↗, its configuration docs↗, its provider list↗ and its GitHub releases↗ as of November 27, 2026.

What did each one hand the app?

I ran OAuth2 Proxy 7.15.6 from the project's own Compose file for local testing, with Dex 2.45.1 as the identity provider, its one test user admin@example.com, and httpbin as the app, which echoes the headers it receives, apart from a few proxy headers it hides, such as X-Forwarded-For. The only change to the files was a fresh cookie secret. Access ran on a test setup with the same Dex image and test user (Dex had a temporary public address) and the same httpbin image behind the connector. The commands and numbers come from my own runs.

After the sign-in through OAuth2 Proxy, httpbin got the person in two headers:

Text
    "X-Forwarded-Email": "admin@example.com", 
    "X-Forwarded-User": "CiQwOGE4Njg0Yi1kYjg4LTRiNzMtOTBhOS0zY2QxNjYxZjU0NjYSBWxvY2Fs"

Behind Access, httpbin got one header, LC-Access-Jwt-Assertion, 917 characters long. It verified against the team's public keys with jose's jwtVerify, the check the identity header docs use, and this is what it says:

Text
  "payload": {
    "iss": "http://localhost:3000/access/t/team_vFy2ZnKpDaxh",
    "aud": "app_3FtR2mgOdP8i",
    "sub": "43a10a6f-ec94-40a7-b370-3593de848918",
    "sid": "7edb741b-fa11-4d88-b09c-9b07b219e182",
    "jti": "96BGgWdjv3vkkea7Uv8Kww",
    "iat": 1795776949,
    "nbf": 1795776919,
    "exp": 1795777549,
    "idp": "oidc:idp_Rzl3XaStOHgk",
    "email": "admin@example.com",
    "email_verified": true,
    "name": "admin"
  }

The issuer is the test setup's. In production it is https://access.localcan.com/t/ followed by your team's ID. What the app gets after sign-in goes through each claim.

Which headers can a client fake?

With each signed-in session, I sent a request that carried identity headers of its own, among them X-Forwarded-Email: ceo@example.com, X-Forwarded-User: ceo, X-Auth-Request-Email: ceo@example.com and Remote-User: ceo, plus a made-up unsigned LC-Access-Jwt-Assertion on the LocalCan side. Through OAuth2 Proxy, httpbin received:

Text
    "Remote-User": "ceo",
    "User-Agent": "curl/8.15.0",
    "X-Auth-Request-Email": "ceo@example.com",
    "X-Forwarded-Email": "admin@example.com",
    "X-Forwarded-User": "CiQwOGE4Njg0Yi1kYjg4LTRiNzMtOTBhOS0zY2QxNjYxZjU0NjYSBWxvY2Fs"

Through Access:

Text
    "Lc-Access-Jwt-Assertion": "<token, 917 chars, verifies, email admin@example.com>",
    "Remote-User": "ceo",
    "User-Agent": "Go-http-client/1.1",
    "X-Auth-Request-Email": "ceo@example.com",
    "X-Forwarded-Host": "e2e-app.example.com"

Both replaced the headers they own. OAuth2 Proxy wrote the signed-in person over X-Forwarded-Email and X-Forwarded-User. LocalCan removed every client-sent X-Forwarded-* header and the made-up token, then added its own token (the X-Forwarded-Host the app got is LocalCan's). Neither touched X-Auth-Request-Email or Remote-User, which neither one sets here, so the app got them as the client wrote them.

On the OAuth2 Proxy setup, a request from a container on httpbin's network skipped the gate, and httpbin took its X-Forwarded-Email: ceo@example.com and X-Forwarded-User: ceo as sent. Plain headers name the right person only when nothing reaches the app around the gate. A signed token can be checked by the app itself, so a made-up one fails wherever the request came from. OAuth2 Proxy can hand over a signed token too: with an OIDC provider, --pass-authorization-header passes the provider's ID token in an Authorization header, which the app can check against the provider's keys.

Close the other ways in with either one. The Access docs say to close every other way to reach the app from the internet, such as a published port (close the other ways in). OAuth2 Proxy's docs add a setting for the X-Forwarded-* headers it reads itself: when --reverse-proxy is on and --trusted-proxy-ip is unset, "a client that can reach OAuth2 Proxy directly may be able to spoof forwarded headers" (configuration overview↗).

If your app reads X-Auth-Request-* headers from an nginx setup with OAuth2 Proxy's --set-xauthrequest, turn that off when the app moves behind Access, since any client can send them there. Settings that read X-Forwarded-User or X-Forwarded-Email get nothing behind Access. Sign people in from LC-Access-Jwt-Assertion only, after checking it (identity header). Grafana and apps that check the header sign people in from it. Metabase, Umami and n8n keep their own login behind LocalCan Access.

What does your server put on the internet?

In the local run, OAuth2 Proxy listened on port 4180 on every interface, and Dex, the provider, on 5556:

Text
tcp46      0      0  *.5556                 *.*                    LISTEN     
tcp4       0      0  *.5556                 *.*                    LISTEN     
tcp46      0      0  *.4180                 *.*                    LISTEN     
tcp4       0      0  *.4180                 *.*                    LISTEN     

In production, OAuth2 Proxy or a reverse proxy in front of it answers on 443 at your server's public address, with a DNS record pointing there and a certificate on that server. Its docs cover TLS with certificate files you supply (--tls-cert-file and --tls-key-file) or at a reverse proxy (TLS configuration↗). For people who sign in from outside your network, the provider's page faces the internet in both setups.

The connector, on a Linux server, as the quick start runs it with Docker after saving the key in a file only the connector can read:

Bash
docker run -d --name localcan-connector --restart unless-stopped \
  --network <your app's network> \
  -v localcan-connector:/data \
  -v /etc/localcan/connector.key:/run/secrets/connector_key:ro \
  -e LOCALCAN_CONNECTOR_KEY_FILE=/run/secrets/connector_key \
  ghcr.io/localcan/connector:1

There is no -p flag. The test connector ran on Docker's host network, where Docker publishes no ports anyway, so the evidence is netstat, which found no listening TCP socket of the connector's process:

Text
published ports: {}
listening: 0
tcp 0 0 127.0.0.1:53694 127.0.0.1:3310 ESTABLISHED 221757/localcan
tcp 0 0 192.168.139.2:41566 0.250.250.254:443 ESTABLISHED 221757/localcan
udp 0 0 :::47970 :::* 221757/localcan

Its TCP connections go out, one to the app on port 3310 and one to the test setup's LocalCan servers, and the UDP socket carries its own outbound tunnel connection to them.

A production app behind Access, a Metabase, looks like this from outside: its hostname is a CNAME that ends at its own .cname.localcan.dev target, LocalCan holds a Let's Encrypt certificate for it, and a browser that opens it gets a redirect to LocalCan's sign-in.

What do you have to patch?

OAuth2 Proxy ships its fixes as releases, 12 between November 8, 2025 and November 5, 2026, the latest being v7.15.6. Its GitHub repository lists 10 security advisories since July 2025, as of November 27, 2026, the latest on October 1, 2026 (security advisories↗). Running it yourself means you apply each release on your own schedule, along with updates to whatever ends TLS in front of it. Is OAuth2 Proxy safe, then? That rests on the setup around it: a current release, the settings its docs flag, such as --trusted-proxy-ip behind a reverse proxy, and an app that nothing reaches around it, as the header test above shows.

With Access, the gate itself runs on LocalCan's servers. The connector is still yours to update: it doesn't update itself, and its menu on the Connectors page shows the version it last connected with (update the connector). With Docker, an update is a pull and removing the container, then the docker run command again:

Bash
docker pull ghcr.io/localcan/connector:1
docker rm -f localcan-connector

Its apps are unavailable for a few seconds while it restarts.

What happens when you remove someone from your provider?

On both setups, I removed admin@example.com from Dex after the sign-in, then tried the existing session and a new sign-in. In both, the session kept opening the app, and Dex refused the new sign-in with "Invalid Email Address and password."

OAuth2 Proxy ran with its defaults. The session lived in the cookie (the file sets no session store), and the start-up log printed a 168-hour expiry with refresh disabled:

Text
[2026/11/27 10:47:53] [oauthproxy.go:187] Cookie settings: name:_oauth2_proxy secure(https):false httponly:true expiry:168h0m0s domains:.localtest.me path:/ samesite: refresh:disabled

At the last check, 1 hour 14 minutes after the removal, the session still opened the app, past the 1-hour lifetime the test file gives Dex's ID tokens. OAuth2 Proxy's docs describe cookie_refresh, which makes it refresh the access token with the provider's refresh token after the interval you set, and they recommend setting it a minute under the access token's lifespan (session storage↗). To end a session from your side, its /oauth2/sign_out endpoint "only removes oauth2-proxy's own cookies", in the browser that opens it (its endpoints page↗).

Access also checks with your provider only when someone signs in, so a session a person already has keeps working after you remove them there until it ends (24 hours by default, 1 to 168 as you set it), and a block or a sign-out under LocalCan Access → People ends their sessions within 2 minutes. Sign out everyone on an app makes everyone sign in to it again (people, blocks and sign-out).

I timed the block on the test setup, through the same function the dashboard's Block calls. In three runs, each block made seconds after the sign-in, the session got through for 60 seconds, and the first refused request came 65 seconds after the block:

Text
2026-11-27T15:13:53Z +60.2s GET /headers with the session -> 200, identity header present
2026-11-27T15:13:58Z +65.2s GET /headers with the session -> 401

A browser on that session went back to sign-in, and signing in again ended on LocalCan's "No access" page: "admin@example.com↗ cannot open e2e-app.example.com".

Where is OAuth2 Proxy the better choice?

  • It costs nothing. OAuth2 Proxy is MIT-licensed. Access is in Preview and priced per app: $29 a month for 3 apps, $69 for 10 and $149 for 30, with unlimited viewers under fair use (LocalCan Access pricing). You can set up three apps before you pay, and they let nobody in until the team has LocalCan Access.
  • Nothing outside your network sits in the path. Behind Access, LocalCan's servers end HTTPS and see each request without keeping it, and they log only the lines what LocalCan can see lists.
  • Your provider can stay on your private network. LocalCan calls your own OIDC provider from its servers and refuses private network addresses, so the provider needs a public HTTPS address (your own identity provider). Google, Microsoft and GitHub need nothing.
  • It runs on more platforms. OAuth2 Proxy has binaries, a multi-architecture image and Kubernetes manifests. The connector runs on Linux, on amd64 or arm64.
  • Its setup is a file. You can review OAuth2 Proxy's config and keep it in git. Access is set up in the dashboard instead: a change needs two-factor sign-in on the admin's account, every change is recorded in the team's audit log (LocalCan Access security), and a rule change reaches people already signed in within 2 minutes.
  • Any email at a domain. OAuth2 Proxy's --email-domain allows every address at a domain. Access has no rule for an address's domain alone. Its Google Workspace rule lets in everyone in the Workspace that owns the domain, since a Google account can be made with any address, and its Microsoft tenant rule lets in the members of that organization. With your own provider, Anyone from your OIDC connection lets in everyone it signs in, which is your company when the provider holds only your people.

What does LocalCan see, and what if it is down?

LocalCan's servers end HTTPS for the app's hostname, since they hold its certificate. They see each request in plaintext, pass it to the connector and stream the response back without keeping it. They log one line per request with the method, host, path, the names of query parameters but not their values, the status, the duration and the visitor's IP address, and a sign-in, a sign-out, a refused request or a service-token call adds a line with the outcome, the host and the IP address. The servers in front of the app never log other headers, cookies or any part of a body (what LocalCan can see).

If LocalCan's servers can't be reached, people already signed in keep working for up to 60 minutes after their last successful check, and new sign-ins wait until LocalCan is back (how fast a change takes effect). Apps that sign people in from the identity header lose it once the token expires, within 10 minutes (identity header). With OAuth2 Proxy, the app is up whenever your server and your provider are.

How do you move an app from OAuth2 Proxy to LocalCan Access?

The quick start has the full steps. For an app that sits behind OAuth2 Proxy today:

  1. Add the app under LocalCan Access → Apps, with the upstream the connector will reach, such as http://my-app:3000 on the app's Docker network. Changes to LocalCan Access need two-factor sign-in on your account.
  2. Run the connector next to the app on Linux, with the command above or with Docker Compose or systemd.
  3. Point the hostname at LocalCan with the CNAME the app's Domain section shows, in place of the record that points at OAuth2 Proxy's server. LocalCan gets the certificate once the CNAME resolves, and browsers see a TLS error for a few minutes until then, so lower the record's TTL beforehand and switch at a quiet hour.
  4. Choose who may sign in. Google, Microsoft and GitHub are ready in every app. For the OIDC provider OAuth2 Proxy used, add it under Sign-in methods with its issuer URL, client ID and secret, and register the redirect URI LocalCan shows. Then turn the rules over: an address from --authenticated-emails-file becomes an email rule, --allowed-group a group rule, and --email-domain a Google Workspace domain, a Microsoft tenant ID, a group from your provider, or Anyone from your OIDC connection (sign-in methods and rules). Adding your own provider needs LocalCan Access on the team (Preview, from $29 a month for 3 apps, see LocalCan Access pricing), which the team owner adds under Billing. Steps 1 to 3 work before that.
  5. Carry over the exceptions. Rewrite each skip_auth_routes entry, an optional method and a path regex, as a public path: a path ending in / covers everything below it, any other matches only itself, a public path is public for every method, and an app has up to 16. Scripts that sent bearer tokens get a service token, sent in its two LC-Access-Client-* headers.
  6. Switch the app to the signed header. Grafana signs people in from it with its JWT settings (Grafana sign-in with a company account), and your own app checks it in a few lines. Metabase, Umami and n8n keep their own login behind LocalCan Access.
  7. Retire OAuth2 Proxy. Stop it and close its port, and check that the app answers only through its hostname.

More posts