Connect your application
Quickstart: an Express application
On this page
Introduction
This guide connects an Express, on expressjs.com application to Signari, so that people sign in to it with their Signari account. The example, examples/express-quickstart, on GitHub, uses openid-client, on GitHub for the protocol. It is about eighty lines.
You register the application, run the example, and sign in. The last sections explain what the example does at each step, and why.
Note
New to Signari? Your first application runs this example and five others on your own computer, with nothing to register by hand.
1. Register the application
Register the example as a confidential client, with the address it listens on as its redirect URI:
Shellsignari client create -org <org-id> -client-id quickstart -name Quickstart \ -redirect http://127.0.0.1:3000/callback
It prints the client secret once. Keep it. A redirect URI is matched exactly: scheme, host, port and path.
2. Run it
Install the example's dependencies, then run it with Signari's address and the values from step 1:
Shellcd examples/express-quickstartnpm ciSIGNARI_ISSUER=https://id.example.com CLIENT_ID=quickstart CLIENT_SECRET=<the secret> \ REDIRECT_URI=http://127.0.0.1:3000/callback npm start
Open http://127.0.0.1:3000/login, sign in, and the page says who signed in. The
versions are pinned in package.json, and everything under them in
package-lock.json, which npm ci installs exactly.
If the engine's certificate is one your machine does not trust, as on a laptop, give
Node the certificate with NODE_EXTRA_CA_CERTS=<file.pem>. Never turn certificate
checking off.
In compose
The demo profile of deploy/docker-compose.yml runs this example from its
Dockerfile, on GitHub as demo-express, the public
client demo-express of deploy/demo/client.yaml, on GitHub, at
http://localhost:8091/login. With the settings that Your first
application
writes to deploy/.env, start it:
Shellcd deploy && docker compose --profile first-run --profile demo up -d
It trusts the development CA under deploy/tls through NODE_EXTRA_CA_CERTS.
What it does, and why each step is there
- Discovery.
client.discoveryreads/.well-known/openid-configurationand refuses an issuer there that is not the one configured. - The redirect out.
/loginmakes a freshstate,nonceand Proof Key for Code Exchange (PKCE) verifier for this one sign-in, puts thestatein a cookie for the callback's path, and sendscode_challenge_method=S256. Signari requires PKCE of every client by default, confidential ones included. - The callback. It takes the
stateback once, and only from the browser whose cookie holds it. Without the cookie, somebody could begin a sign-in, stop at the callback and send that link to you, and you would be signed in as them.authorizationCodeGrantsends the code and the verifier, authenticating withclient_secret_basic, and checks the ID token's issuer, audience, expiry and nonce. - The signature too. openid-client does not check an ID token's signature by
default. OpenID Connect lets a client trust the Transport Layer Security (TLS)
connection to the token
endpoint instead (Core, section 3.1.3.7). This example turns on
enableNonRepudiationChecks, so the signature is checked againstjwks_urias well.
A public client has no secret: leave CLIENT_SECRET unset, register it with
-public, and the example authenticates with its client_id alone. PKCE is then its
only proof.
When something is refused, the message is Signari's own. What each one means is in Troubleshooting.
Verified
On 14 November 2026, with Node 24, Express 5.3.0 and openid-client 6.9.0, against a
running engine over TLS. Ada signed in through the engine's own sign-in and consent
pages and the application said "Signed in as ada@staff.test". The engine's access log
showed the discovery document, the token call and, right after it, /oauth2/jwks,
fetched for the signature check. A callback with a state the application never gave
was refused.
Since 29 November 2026, continuous integration (CI) runs this example in the compose
stack's demo profile whenever it, the stack or the engine changes, and once a week.
A new person signs in to it in Chrome, with a password and then by single sign-on,
and the run fails unless the application says "Signed in as" them. The job is
.github/workflows/quickstarts.yml.