Skip to main content
When a Quintus agent calls your MCP server, n8n workflow or HTTP endpoint, the call arrives on behalf of a user. This page shows how to turn on the identity token and how to validate it, so your system knows who asked for the action and in which company.

What it is

The identity token is a short-lived JWT, signed by Quintus with ES256, that says which Quintus user, in which company (tenant), triggered the call.
  • It is not a user credential and cannot be used to call the Quintus APIs.
  • It carries no roles or permissions. Your system decides what the user may do, by mapping sub or email to the permissions you already keep.

How to enable it

The identity token is optional, off by default, and only a company administrator can turn it on.
1

Open the connector or the webhook

On the custom connector, go to the Identidade do usuário (User identity) section. On the agent webhook, open the webhook form and use the same option.
2

Turn on the token

Switch on Enviar token de identidade do usuário (Send the user identity token).
3

Choose what to include

Optionally switch on Incluir e-mail (Include email) and Incluir nome (Include name). Connectors also have Enviar também no header X-Quintus-Identity (Also send it in the X-Quintus-Identity header).
4

Webhooks: declare the body key

To also receive the token in the JSON body, add {"json": {"quintus_identity": ""}} to the webhook’s Dados adicionais (Additional data). Quintus fills the empty value on every call.

Where the token arrives

Quintus issues a new token on every call. It never goes in a tool argument, URL or query string, and the model never sees it. MCP tool call: in the request’s _meta field, on every call.
Header: the X-Quintus-Identity header carries the same token.
For MCP, the header is only sent on HTTP transports (streamable-http or SSE), with Enviar também no header X-Quintus-Identity (Also send it in the X-Quintus-Identity header) switched on. Local connectors run by Quintus Desktop receive only _meta. On webhooks with the option enabled, the header is always sent. Webhook body: with {"json": {"quintus_identity": ""}} in the additional data, the body you receive has the key filled.
Prefer reading _meta. Turning the header on makes Quintus open a new MCP session to your server on every tool call, which is slower and puts more load on the server. Use the header only if your server cannot read _meta.
Local connectors run by a Quintus Desktop version that does not advertise request_meta support receive no token at all (neither in _meta nor in the header): update Quintus Desktop. Async tools of an opt-in connector (tools whose result comes back later through the integration callback) also do not receive the token.

Claims

The token’s JOSE header has alg = ES256, kid (the signing key) and typ = quintus-connector-identity+jwt. The body has exactly these claims:

How to validate

The public keys are at https://sso.quintus.tec.br/.well-known/connector-identity-jwks.json. Follow these steps in this order:
  1. Fetch the keys from that URL (JWKS) and pick the key by the token’s kid. Cache them and fetch again when an unknown kid shows up.
  2. Accept alg ES256 only. Reject none, HS* and RS*.
  3. Check that iss is https://sso.quintus.tec.br/connector-identity.
  4. Check that aud is the id of your own connector or webhook. Refuse tokens issued for another one.
  5. Check that tenant is your company’s id in Quintus (ask Quintus support if you don’t know it). Refuse tokens from another company.
  6. Check that exp has not passed (clock tolerance of at most 60 seconds) and that the typ claim is connector-identity.
  7. Check that the jti has never been seen: store each jti until its exp plus the clock tolerance (so a replay inside the tolerance is also refused) and refuse repeats.
  8. Only then authorize the action by sub or email.
Refuse the request when the token is absent or invalid. Never fall back to a user id sent in arguments or params. The USER_ID and TENANT_ID connection placeholders are filled only by the platform and cannot be overridden by connection params, but they are not signed: use the token for authorization decisions.

Example: n8n

n8n’s JWT node does not read a JWKS URL and does not check iss or aud. So the workflow uses the PEM public key in the JWT node and checks the rest in an IF node.
1

Receive the call

Add a Webhook node as the trigger.
2

Verify the signature

Add a JWT node with the Verify operation. For Token, use {{ $json.headers["x-quintus-identity"] }} (or {{ $json.body.quintus_identity }}). In the JWT Auth credential, use Key Type PEM Key, Algorithm ES256 and, in Public Key, the PEM of the current JWKS key (see below).
3

Check issuer, audience, tenant and type

Add an IF node requiring {{ $json.payload.iss }} to equal https://sso.quintus.tec.br/connector-identity, {{ $json.payload.aud }} to equal your webhook id, {{ $json.payload.tenant }} to equal your company’s id in Quintus and {{ $json.payload.typ }} to equal connector-identity. Connect your actions only to the IF node’s “true” output, after Remove Duplicates; the “false” output must not reach them.
4

Refuse replays

Add a Remove Duplicates node with the Remove Items Processed in Previous Executions operation and the value {{ $json.payload.jti }}.
To convert the JWKS key to PEM, save this as jwks-to-pem.mjs and run node jwks-to-pem.mjs:
The JWT node does not read a JWKS URL: update the PEM when Quintus rotates its keys (a new kid appears in the JWKS). The symptom is verification failing for a token that looks valid. The node refuses an invalid signature or an expired token; do not enable Continue On Fail on it.

Code examples

In a Python MCP server (FastMCP, the mcp SDK), read the token from the request’s _meta and pass it to the verifier:

When the token is not sent

Quintus does not send the token in these cases, and your system must treat its absence as “unknown user”:
  • API-key integrations (including the Agents API), even on a connector or webhook with the option on.
  • The public chat and the chat widget, even on a connector or webhook with the option on.
  • Connectors and webhooks without the option on.
  • Local connectors on Quintus Desktop without request_meta support.
  • Async tools of an opt-in connector (result returned through the integration callback).
  • When Quintus cannot issue the token (for example, SSO is unavailable): the call goes on without it.

Security

  • Never write the token to logs.
  • The token proves identity for at most 5 minutes and for a single connector or webhook.
  • Never forward it to third parties.