# Signed app identity integration guide

> Let your app verify who signed in through qURL. Reuse email access and the existing browser session, then verify the signed identity on every request.

Source: https://layerv.ai/docs/signed-identity/

---

Enterprise integration guide

# Give your app a verified user identity.

A visitor verifies their email through qURL. Your app receives a signed X-QURL-Identity header on each authorized request. Reuse that sign-in for app users and audit records. Keep your app permission checks.

Resource owners can enable this themselves with qURL CLI 4.5.0 or later.

## 1\. Publish with email access

For a local app, use the [CLI walkthrough](https://qurl.link/signed-identity). These commands use a macOS or Linux shell. For an existing hosted HTTPS app, first make the origin reject requests without a secret X-Origin-Secret header. Load the secret into ORIGIN\_SECRET from your secret store, then run:

Publish an HTTPS origin

```
APP_URL='https://your-app.example.com'
: "${ORIGIN_SECRET:?Load your origin secret first}"
printf '%s' "$ORIGIN_SECRET" | qurl publish "$APP_URL" \
  --name "Team app" --access email_capture \
  --origin-header X-Origin-Secret -o json
qurl whoami -o json
```

Save the returned crid and the owner\_id from whoami. The origin secret goes through standard input. For an interactive hidden prompt, omit the pipe. Publishing does not close an existing public origin: keep its secret-header check in place.

## 2\. Verify the identity in your app

Put verification before your app handlers, including page and asset handlers. Require exactly one X-QURL-Identity header. Reject missing, duplicate, invalid, expired or incorrectly scoped assertions.

__Fixed production verification settings__
| Setting                 | Required value                              |
| ----------------------- | ------------------------------------------- |
| JWKS                    | https://api.layerv.ai/.well-known/jwks.json |
| Algorithm               | Ed25519, not EdDSA                          |
| Token type              | qurl-identity+jwt                           |
| Issuer (iss)            | https://qurl.link                           |
| Audience (aud) and crid | Your exact resource CRID                    |
| tenant\_id              | The resource owner\_id                      |

Pin these values in app configuration. Use the configured JWKS to verify the signature; never take a key URL or expected issuer from the token. Verify locally with cached public keys; do not fetch JWKS for every request. Check that your JWT library supports the exact Ed25519 algorithm name.

Verification and key rotation checks 
- Limit the header to 4,096 bytes. Require a kid that selects a public Ed25519 signing key.
- Require non-empty sub, jti and grant\_id, plus integer auth\_time, iat, nbf and exp.
- Require nbf to equal iat, exp to be after iat, and exp − iat to be at most 60 seconds. Accept at most 15 seconds of clock leeway.
- Require auth\_time to be no later than iat. Apply your own maximum sign-in age to auth\_time.
- Cache public keys for 60 seconds. Coalesce refreshes and limit unknown-kid refresh attempts. After one bounded refresh, reject a key that remains unknown. Fail closed if an expired key cache cannot refresh.
- Map app users by the verified pair iss and sub. Email is optional and is present only after mailbox verification and disclosure consent.
- Keep app permissions and CSRF checks. Do not log, reflect or store the raw assertion in a browser. It is a bearer credential until expiry, not a single-use token.

Keep the app private through its Connector, or keep the hosted origin secret check. Reject unsigned requests even when an app session already exists. Do not serve one user's authenticated response from a shared cache.

## 3\. Enable and test

Enable signed identity

```
CRID='paste-your-crid'
qurl identity enable "$CRID"
qurl identity status "$CRID"
printf 'https://qurl.link/%s\n' "$CRID"
```

Status must report signed identity enabled. Open the printed address, complete email verification, and check that your app accepts the signed request. Use this CRID address for email access; qurl share creates a device-authorized link instead.

Test missing and forged headers, a different CRID or tenant, expired assertions, and page assets. Each invalid request must fail. A supplied client identity header must never replace the gateway's assertion.

Check disable and re-enable

```
qurl identity disable "$CRID"
qurl identity status "$CRID"
# Reload the app: it must refuse requests while it requires signed identity.
qurl identity enable "$CRID"
```

Disable stops new assertions. Assertions already issued remain valid until their short expiry. The switch does not revoke access grants or reset sign-in time. Re-enable and check the same user identity; a session that has expired needs fresh email verification.

To remove a test resource, stop its Connector, run `qurl delete "$CRID"`, and confirm when asked.



---

*This markdown version is auto-generated from [https://layerv.ai/docs/signed-identity/](https://layerv.ai/docs/signed-identity/) for AI agents. Curated agent resources: [llms.txt](https://layerv.ai/llms.txt). For the full interactive experience, visit the HTML version.*

