Security

Build secure identity boundaries.

Protect every stage of your Egreed ID integration: authorization, callback handling, token verification, credential storage, scope selection, session renewal, and incident response.

Production checklist

Require PKCE

Use authorization code with an S256 challenge for public clients.

Validate state and nonce

Reject callbacks that do not match the values created for the original request.

Use exact redirect URIs

Register HTTPS callback addresses and avoid permissive redirect matching.

Request least privilege

Ask only for scopes needed by the current feature.

Keep secrets server-side

Never put API keys, client credentials, or refresh tokens in browser code.

Plan revocation

Handle expired and revoked credentials without retry loops or data leakage.

Validate tokens

Egreed ID signs ID tokens with RS256. Resolve signing keys from /api/public/oauth/jwks, select the matching key ID, and verify the signature locally. Also validate issuer, audience, expiry, and nonce before trusting claims. Do not use decoded claims until verification succeeds.

Protect API keys

Create separate Test and Live keys, give each key the minimum necessary scopes, choose an expiry, and store the raw value only in a server-side secret manager. Egreed ID stores key material as SHA-256 hashes and records last use. Rotate keys when ownership, deployment, or access requirements change.

Never ship an API key to a browser. Browser and mobile applications must use the authorization code flow with PKCE.

Sessions, refresh tokens, and devices

Refresh tokens rotate after every successful use. Persist the replacement atomically and treat reuse as a security incident because the full chain is revoked. With sessions:read, review known devices and trust state; with sessions:revoke, remove device trust remotely.

Audit and integration logs

Out-of-scope requests are rejected with HTTP 403 and entered in the integration access log. Use audit:read to forward security and account events to your monitoring or SIEM workflow. Do not write access tokens, refresh tokens, API keys, authorization codes, or full identity payloads into your own logs.