Deno Deploy
Deployments authenticate as the app and context they run in.
Deployments authenticate as the app and context they run in.
What proves the identity
The token has to come from https://oidc.deno.com, and its sub claim has to match the workload you named. penv compares that claim byte for byte, with no wildcards.
Every token also has to name your workspace as its audience. Ask for this audience and no other. A token requested for two audiences fails every exchange.
What the console asks for
| Field | Example | Advanced | What it pins |
|---|---|---|---|
| Organization slug | acme | no | The issuer is shared by every Deno customer, so this is what scopes the trust. |
| App | api | no | |
| Context | production | yes |
A field marked advanced carries a default and stays behind the disclosure until you open it.
The console also asks which project and environment this identity reaches and which role it gets, with the credential lifetime behind Advanced.
What the trust holds
Built from the example answers above:
| What | Value |
|---|---|
| Issuer | https://oidc.deno.com |
| Claim compared | sub |
| Subject | deployment:acme/api/production |
| Identity name | deno-api-production |
penv names the identity for you, so the form never asks for one.
The snippet the console prints
import { getIdToken } from "jsr:@deno/oidc";
const T = await getIdToken("YOUR_WORKSPACE_ID");
const r = await fetch("https://penv.cloud/api/v1/auth/oidc", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ token: T }),
});
Deno.env.set("PENV_TOKEN", (await r.json()).credential);Related
- Machine identity
- Connect a Platform in the console
- Deno Deploy documentation, where the value people get wrong is always the subject