Skip to main content
Your backend signs an identity assertion, creates a five-minute approval session, and redirects the authenticated end user to Attesso. The assertion and approval URL are bearer secrets and must not be logged.

Configure approval trust

Before an approval session can be opened, register your identity provider in the dashboard (per environment: test and live). The API verifies the signed assertion it receives against these three values and refuses anything else. Return to the origin you registered exactly: https://app.example.com is allowed, and so is https://app.example.com/approval-return — only the origin (scheme + host + port) is compared, so a path is fine. Generate an ES256/P-256 key pair on your own infrastructure and register only its public key:
Derive the public JWK from that PEM with the same jose tooling used to sign assertions (see below):
The registered JWK must be the public key that corresponds to the exact private key you sign with. Give it a stable kid and reference that same kid in the assertion header.

Identity assertion contract

The compact JWS must use: Attesso accepts only the configured issuer and public JWKs. It never fetches a key URL from the token and never receives your private key.

TypeScript

Install jose, load the key from your secret store, and keep the resulting token in server memory only.

Python

Install PyJWT[crypto] and apply the same fixed algorithm and claims.

Create and handle the session

Send the assertion with an exact pre-registered return origin and unpredictable return_state to POST /v1/mandates/{mandate_id}/approval-sessions.
approval_url is a five-minute, single-use bearer URL. Redirect to it without analytics, logging, browser storage, or email.
After the passkey ceremony, Attesso returns the browser to your configured URL with an approval result in the fragment. Validate attesso_state, then retrieve the Mandate with your backend API key. The redirect is not proof of approval; the server-to-server Mandate state is authoritative. If a session expires, reauthenticate the user and create a new session. Never attempt to recover or reuse the old approval URL.