E2EE key safety
E2EE key safety
Keep app keys and private keys on the client; never send them to your backend
Remove key-bearing URL fragments from the address bar immediately after parsing
Load analytics, session replay, and error reporting after the fragment is removed, or configure them to drop fragments
Normalize base64 fragments before decoding — replace
(space) with +Keep per-identity encrypted data partitions — never mix data across identities
Use a fresh random IV for every AES-GCM encryption
Request
e2ee:reset only from an explicit user actionNever log raw key material
Use the embed SDK for iframe flows; it only accepts
postMessage from the Ave issuerOAuth request hardening
OAuth request hardening
Always generate and verify
state to prevent CSRF attacksAlways generate and verify
nonce when requesting id_tokenUse PKCE (
S256) for every public client (SPA, mobile, desktop)Register exact redirect URIs — no wildcards, no trailing-slash variations
Token storage and handling
Token storage and handling
Treat
access_token, access_token_jwt, and refresh_token as secretsPrefer server-side token storage (HTTP-only cookies, encrypted session)
If browser storage is necessary, use
sessionStorage over localStorage — never localStorage for refresh tokensRotate app sessions after a refresh or privilege change
ID token validation
ID token validation
When validating an
id_token JWT received from Ave, check all of the following:Signature valid against JWKS from the Ave OIDC discovery document (
{issuer}/.well-known/jwks.json, where issuer is the issuer value from /.well-known/openid-configuration)iss equals the issuer value from the Ave OIDC discovery document (e.g. https://aveid.net on the hosted service)aud equals your clientIdexp is in the futureiat is recent (within an acceptable clock skew)nonce matches the value you sent at authorization timeReject tokens with missing or unexpected values for any of the above
Keep your service clocks synchronized (NTP). JWT validation is time-sensitive — a clock that’s off by more than a few minutes will cause false rejections or accept expired tokens.
Operational monitoring
Operational monitoring
Monitor spikes in
invalid_grant errors — may indicate token replay or reuse attacksMonitor spikes in
invalid_scope errors — may indicate misconfigured clients or probingTrack refresh token failure patterns to detect stolen tokens
Rotate app credentials (
clientSecret) periodically