Problem. Edge Functions have no way to prove their identity to third-party services. To call a vendor API, a function needs a long-lived secret stored in function secrets. Platforms like Vercel, GitHub Actions, AWS and GCP solve this by issuing a short-lived, signed OIDC token per invocation, which identity brokers and clouds verify through a public JWKS.
Request. Issue a short-lived OIDC JWT to each Edge Function invocation (env var or local endpoint), signed by a per-project issuer with a public /.well-known/openid-configuration and JWKS. Suggested claims: iss (project issuer), sub (project:<ref>:function:<slug>), aud (configurable), exp (minutes), plus project_ref and function_slug.
Why it matters. It removes stored secrets from functions and enables workload identity federation with AWS STS, GCP, Azure, and workload IAM vendors like Aembit, who has said they would add Supabase as a trust provider once such a token exists.
Our case. We run about 40 Edge Functions that call CRM and AI vendor APIs. Today they route through a relay on Vercel only because Vercel can attest its identity and Supabase cannot. Native tokens would let us remove that relay.
David15999 requests the ability for Edge Functions to use short-lived OIDC tokens to authenticate with third-party services, similar to solutions provided by platforms like Vercel and AWS. This feature would enhance security by eliminating the need for long-lived secrets. Solvionsolutions suggests a workaround using a custom OIDC issuer, but acknowledges it doesn't fully replace the requested native feature.
Until there's a native token, you can get short-lived vendor credentials (no static AWS/GCP keys) by making the project its own OIDC issuer.
OIDC_PRIVATE_KEY (names can't start with SUPABASE_).oidc (verify_jwt = false) that serves /.well-known/openid-configuration with issuer https://<ref>.supabase.co/functions/v1/oidc and a jwks_uri returning the public JWK.import { SignJWT, importPKCS8 } from 'npm:jose@5'
const key = await importPKCS8(Deno.env.get('OIDC_PRIVATE_KEY')!, 'RS256')
const jwt = await new SignJWT({ function_slug: 'crm-sync' })
.setProtectedHeader({ alg: 'RS256', kid: 'k1' })
.setIssuer(ISSUER)
.setSubject('project:<ref>:function:crm-sync')
.setAudience(AUDIENCE)
.setIssuedAt().setExpirationTime('5m')
.sign(key)
sub and aud in the trust policy, and exchange the JWT (e.g. AssumeRoleWithWebIdentity).Verify: curl https://<ref>.supabase.co/functions/v1/oidc/.well-known/openid-configuration and decode one token.
The limit: the signing key is still a long-lived secret, and anyone who can deploy functions or read secrets can mint any sub. It replaces 40 vendor secrets with one key and per-function scoping, not platform attestation, so it supports the request rather than replacing it.