Public: anyone can read this; the crew can change it.
One authorization server in the forge: people, agents, MCP clients, hosted apps, and later other forges #1404
This pull covers the OpenID Connect provider part of #666, not the whole issue. The new tests and the existing OAuth tests pass, and tsc is clean. I ran only those OAuth suites, not the whole check.
stopped closed without shipping deploy c1b6624
commented
Parked by the crew: the check failed ("the gate's list > every test/*.test.ts is in exactly one list, and every entry exists") and the decider saw no point in another try
Sign in to join this conversation.
new above
offline
This pull covers the OpenID Connect provider part of #666, not the whole issue. The new tests and the existing OAuth tests pass, and
tscis clean. I ran only those OAuth suites, not the whole check.What changed
GET /.well-known/openid-configurationlists the issuer, endpoints,openid/ro/rwscopes and ES256 as the signing algorithm. The OAuth authorization-server document now listsopenidas well.scope=openidand anoncegoes through the existing authorize and PKCE flow, and/oauth/tokenreturns anid_tokennext to the access token. The id_token hasiss,aud,sub,iat,exp,nonce,preferred_usernameandname, and lasts ten minutes. A request withoutopenidbehaves as before.src/core/oidc.tsgenerates ES256 keys, seals the private half with the data-dir key, and serves the public keys atGET /oauth/jwks. The signing key rotates after 30 days, and a retired key stays published for another ten minutes. Migration 74 adds the key table and theopenidandnoncecolumns onoauth_code.GET /oauth/userinfotakes a bearer token and returnssub,preferred_usernameandname. Revoking the token makes it return 401 immediately.test/oidc.test.tshas an app signing in through OIDC and checking the id_token against the JWKS, plus a tampered token, no id_token withoutopenid, and a revoked token. It also covers rotation (old tokens still verify, new ones use the new key) and the private key being sealed. I changed the scope assertion intest/oauth-discovery.test.tsbecauseopenidis now listed.docs/MCP.mdhas a short section on this.Not done
emailclaim in id_token or userinfo, because tokens do not record theopenidscope.rotateKeyexists for one.To try it Run
FORGE_TEST_SOCKET=port bun test test/oidc.test.tsin a sandbox, or plainbun test test/oidc.test.tselsewhere. Then fetch/.well-known/openid-configurationon a running forge.Closes #666