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:
jose tooling used to sign assertions (see below):
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
Installjose, load the key from your secret store, and keep the resulting token in server memory only.
Python
InstallPyJWT[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 unpredictablereturn_state to POST /v1/mandates/{mandate_id}/approval-sessions.
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.
