Authentication modes
Every public access entry on an application carries an authentication mode. The check happens at Caddy on the device hosting the workload, before any request reaches the workload itself. The six modes:
none — public
Section titled “none — public”policies: { auth: { modes: [none] } }Anyone who knows the URL can reach the service. No credential check. Use for marketing sites, public APIs, anything genuinely meant to be open.
If you don’t want the URL itself to be discoverable, pair none with a generated (random-suffix) hostname. The hostname acts as a weak shared secret — fine for low-stakes sharing, not fine as a real access control.
edgible-login — Edgible organization members only
Section titled “edgible-login — Edgible organization members only”policies: { auth: { modes: [edgible-login] } }A request reaches the workload only if the requester has a valid Edgible session for a member of your organization. Visiting in a browser triggers a sign-in flow; if the user is a member of the right org, the request goes through and the user stays logged in for the session.
Use for internal tools — dashboards, admin UIs, on-call runbooks. It removes the need to run a VPN: your team logs into Edgible (which they already do) and the existing session also serves as the authn for these tools.
The check is membership only — a per-app role model isn’t part of edgible-login mode. If you need finer-grained authorization, do it inside your application after the request lands. To restrict to a subset of organizations, set policies.auth.allowedOrganizations.
api-key — API key
Section titled “api-key — API key”policies: { auth: { modes: [api-key] } }The request must include an API key issued for this application. Keys start with sk_. The
gateway only routes encrypted traffic by hostname and never sees the key. The check happens on
the serving device: Caddy hands each request to a local auth service, which asks the platform
whether the key is valid and remembers a valid answer for up to 5 minutes. Deleting a key tells
the serving devices to forget it, so it stops working within seconds (at most 5 minutes on a
device that misses the message).
Issue a token with the CLI:
edgible application api-keys create \ --app <app-id> \ --name "ci-deploy-key" \ --expires 2026-12-31Send it on every request, as a bearer token, in an X-API-Key header, or as the password in
HTTP Basic auth (any username):
curl https://api.example.com/v1/things \ -H "Authorization: Bearer sk_..."
curl https://api.example.com/v1/things \ -H "X-API-Key: sk_..."
curl -u "any:sk_..." https://api.example.com/v1/thingsKeys in query strings are not supported. A missing or wrong key gets 401 with a
WWW-Authenticate: Basic challenge, which git and calendar or contact sync apps need before they
send a password — see Connect git, phone apps and other tools.
Tokens can be listed (api-keys list), deleted (api-keys delete), and given an expiry. Rotation is your responsibility — the platform doesn’t auto-rotate API keys.
Use for programmatic access from scripts, CI pipelines, partner integrations, or any other machine consumer.
short-code — rotating short-lived tokens
Section titled “short-code — rotating short-lived tokens”policies: { auth: { modes: [short-code] } }Like api-key, but the token is shorter, the lifetime is shorter, and it can be capped to a maximum number of uses. Designed for sharing brief access — “send this link to the contractor for the next two hours.”
edgible application short-codes create \ --app <app-id> \ --name "contractor-access" \ --expires "2026-04-30T18:00:00Z" \ --max-uses 50The created code is included in the URL or in a query parameter, depending on how the consumer wants to use it. Toggle a code on or off without deleting it (short-codes toggle).
Use when you want to share access without provisioning an account, and you want the access to disappear on its own.
app-native — your application’s own login is the control
Section titled “app-native — your application’s own login is the control”routes: - path: /* target: { workload: web, port: http } policies: { auth: { modes: [app-native] } }The platform passes the request through unchanged: the application’s own authentication is
the declared access control. This is deliberately distinct from none — none declares the
path genuinely anonymous, while app-native records that a check exists, just not a platform
one. Two constraints, both enforced:
- Exclusive.
app-nativecannot be combined with any other mode — pass-through plus a platform check is contradictory, and the platform rejects the combination. - Path-scoped. Declare it on a
routes[]entry (or a legacypathPoliciesentry), not as an access-levelpolicies.auth.modesvalue — the platform rejects it at the root.
oauth — AI assistant sign-in
Section titled “oauth — AI assistant sign-in”routes: - path: /mcp target: { workload: tools, port: http } policies: { auth: { modes: [oauth] } }The route accepts OAuth sign-in from Edgible’s authorization server, for exactly the people
edgible-login would let in: members, of any role, of your organization or of the
organizations in allowedOrganizations. This is how claude.ai, Claude’s mobile apps, ChatGPT
and other assistants that can only “sign in” connect to an MCP server you host on Edgible. It
is plain OAuth 2.1 bearer authentication, so any OAuth client can use it, not only MCP
clients. Your application runs no OAuth code.
The URL to give the assistant is the hostname followed by the route’s path without a trailing
/*. For the route above that is https://tools.acme.edgible.app/mcp; /mcp/* gives the same
URL, and oauth on the access itself (or on a /* route) gives the hostname alone. The console
shows the URL with a copy button once the mode is on. A custom hostname is a URL of its own: an
assistant connected through one isn’t connected through the other.
The first time an assistant connects, Edgible asks the person in their browser:
Connect Claude to tools (tools.acme.edgible.app/mcp), an app of Acme. The page says what
your app will learn about them (name, email address and user id). After they allow it, every
request reaches your app without its Authorization header and with these headers instead:
| Header | Value |
|---|---|
X-Auth-Type | oauth |
X-Auth-User-Id | The person’s Edgible user id |
X-Auth-Email | Their email address |
X-Auth-User | Their name, else their email address |
X-Auth-Organization-Id | The organization that let them in: the first in allowedOrganizations they’re a member of |
X-Auth-Client-Id | The assistant: its client metadata URL (https://claude.ai/…) or a dcr_… id |
X-Auth-Grant-Id | The connection, the same id the person sees in Connected apps |
edgible-login sends the same identity headers, with X-Auth-Type: org. The edge deletes any
X-Auth-* header a client sends, on every route, so your app can trust them, as long as it is
reached only through Edgible.
Rules, all checked when you apply:
- Not with
edgible-loginorshort-code. A request with no credentials must get a sign-in challenge for OAuth but a redirect to the login page for those modes, so they can’t share a modes list. Put the AI assistant endpoint on its own route, as in Apps that also use Edgible login.oauthcombines withapi-key:[oauth, api-key]accepts either. - One URL, one policy. A
/mcp/*route also answers/mcpitself, unless you declare an exact/mcproute too. Two routes that come to the same URL (/mcpand/mcp/*) must have the same modes and allowed organizations. - Serving devices only.
oauthis refused oncloudandautomaticplacement, and on a move to one. It needs agent 1.4.40 or later on the serving device. - IP rules. An IP allow list or
ipRules.autodrops connections from assistants that run in their provider’s cloud, such as claude.ai and ChatGPT. The apply warns, without refusing: desktop assistants on listed addresses still work. - Not in the deprecated
pathPolicies.
People see and revoke their connections under Account → Connected apps, and owners see the
organization’s on its AI assistant access page. A connection also ends when the person
leaves the organization, when the route stops using oauth or changes hostname, and after 90
days without a call. Each new token is checked with Edgible, then remembered on the serving
device for up to 5 minutes. If the device can’t reach Edgible to check one, the assistant gets
503 with Retry-After and keeps its sign-in.
Combining modes
Section titled “Combining modes”auth.modes is a set — list more than one and they are OR-combined: a request that satisfies any listed mode is served. The common case is letting both humans and machines reach the same endpoint:
policies: { auth: { modes: [edgible-login, api-key] } }A browser with no credential is redirected to the Edgible login (the edgible-login behavior),
while a request carrying a valid Authorization: Bearer <key> or X-API-Key: <key> is served
directly (the api-key behavior) without the redirect.
A request that carries a wrong key gets 401, not a redirect to the login page. Only a
request with no credentials at all is redirected.
none is exclusive — it means “no check at all,” so it cannot be combined with another mode; the platform rejects [none, …].
oauth can’t share a modes list with edgible-login or short-code (see
AI assistant sign-in); give it its own route.
auth.modes combines auth methods on one endpoint — it is not how you give different
audiences different policies. For different auth per path on the same hostname, use a
routes[] table with per-route policies.auth; the
common case of protecting only /admin is worked through in
Login on certain paths only. For
genuinely different surfaces — separate hostnames, separate TLS — declare multiple access
entries, one per audience, each with its own auth.modes (requires agent ≥ 1.2.0 on the
target device). See
Multiple access entries for the worked example.
Browser apps and CORS
Section titled “Browser apps and CORS”Before a cross-origin call such as fetch with an Authorization or X-API-Key header, a
browser first sends a “preflight”: an OPTIONS request that carries no credentials. The auth
gate would reject it, so browser apps could not call protected applications. The cors policy
on an https access decides what happens to preflights:
off(default) — the edge refuses preflights with403. Nothing reaches your application.passthrough— preflights go to your application without authentication, so your own CORS code answers them. Real requests are still authenticated.managed— the edge answers preflights itself from an allow-list of origins, methods and headers you declare.
policies: auth: { modes: [api-key] } cors: { mode: passthrough }Preflights are not authentication events: they are not checked against keys and don’t count
toward failed-login alarms. Requires agent 1.4.14 or later on the serving device. With
edgible-login, the policy applies, but cross-site browser calls that rely on the login session
are not supported. See the cors fields for the full
list, and Protect with API keys for an example.
What none of these modes are
Section titled “What none of these modes are”Edgible’s auth modes authenticate the caller — they don’t authorize the call beyond
membership. None of them inspect the request body, and none of them read JWT claims for your
application. Per-path scoping exists (routes[] carries per-route policies.auth), but the
check is still caller authentication, not authorization. Anything beyond “the caller has a
credential” lives inside your workload — Caddy hands the request through, and you decide what
the user is allowed to do.
For WAF-style request inspection, IP allow-lists, and rate-limiting, see the additional policies fields documented in the YAML reference.