relyingparty.app
Authenticate with Comms.ID, ready to copy
Each template below is a small app that already authenticates people with Comms.ID. Open it, authenticate, then copy it and make it yours. Each one runs live here, on its own host, with its own registration.
Templates
-
Plain HTML
A static page with the Authenticate with Comms.ID button, and a small Worker that asks Comms.ID who is authenticated. No build step for the page.
npx @comms-id/cli create html my-app -
React
A Vite React app with the Authenticate with Comms.ID button, served by the same kind of Worker.
npx @comms-id/cli create react my-app -
Next.js
Next.js on Cloudflare Workers: the page asks Comms.ID who is authenticated, on the server.
npx @comms-id/cli create nextjs my-app
Make it yours
- Install the new app in its folder:
cd my-app && pnpm install. - In
wrangler.jsonc, set the Worker name andCOMMS_ID_REDIRECT_URItohttps://<your host>/. - Deploy it once:
pnpm run deploy. The page and the sector document are live; the session route answers that it is not set up yet. - Make the signing key:
npx @comms-id/cli key --worker <your Worker>. It puts the private key in the Worker secretCOMMS_ID_PRIVATE_JWKand prints the public key. - Register the app in Companion: the public key, the redirect URI, the sector document
https://<your host>/oidc/redirect_urisand the authentication class. - Set
COMMS_ID_CLIENT_IDto the client id Companion gives you, and deploy again.
Each template's README.md has the details. Nothing of Comms.ID's is installed: one script tag shows the button, and one request signed by the app's key asks who is authenticated. The app keeps the key on its server; the browser holds only a session-only cookie with the held id.
What these templates keep
Nothing. Comms.ID holds the session; each template keeps only the held id, in a cookie that ends with your browser session, and asks Comms.ID who it is for (your pairwise id for that template, and your Team Membership when you authenticate for a Team) when you act on the page. The session ends about 5 minutes after your last action on the page, and 4 hours after you authenticate at the latest. No token is kept, and no name is asked for.
The templates are our own test bed: they authenticate against production Comms.ID, and nothing depends on them. Each template is its own app, so each one sees a different id for you.