> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# OAuth security

How Zernio protects OAuth grants, and what your app has to do to keep its users' tokens safe.

Zernio enforces PKCE, exact redirect matching, short-lived access tokens and rotating refresh tokens. Your app still holds tokens that act in a customer's workspace: treat them like passwords.

## What Zernio enforces

- **PKCE for every client.** `S256` only. A stolen code is useless without the verifier.
- **Exact redirect matching.** The `redirect_uri` must equal a registered one. Loopback URIs may differ only by port.
- **One-time codes.** A code expires after 10 minutes and works once.
- **Short access tokens.** They expire after 1 hour.
- **Rotating refresh tokens.** Each refresh replaces the token. The old one works for 60 seconds, then until the new one is used.
- **Revoke ends the grant.** Revoking your latest refresh token or a current access token revokes every token of that authorization.
- **Narrow grants.** A token reaches only its scopes, in one workspace. Ad, refund, payout and money writes start at Read on the consent screen.
- **No admin access.** No token reaches API keys, invites, connected apps, members, SSO or account deletion.
- **Mix-up protection.** The callback carries `iss=https://zernio.com` (RFC 9207).
- **No caching.** Registration and token responses are sent with `Cache-Control: no-store`.

## What your app must do

- Make a new `state` and PKCE verifier for every authorization. Tie `state` to the user's session, for example in a cookie, and check it on the callback.
- Never log the authorization code or put it in analytics. Exchange it at once.
- Check that `iss` is `https://zernio.com`.
- Exchange codes and refresh tokens on your server. Never put a client secret in a browser or mobile app.
- Store tokens encrypted, and never log them.
- Save the new refresh token after every refresh, and run one refresh at a time per user.
- Keep refresh tokens as secret as passwords. Zernio does not detect refresh token reuse. A stolen refresh token keeps working until the grant is revoked.
- Revoke the token when a user disconnects or deletes their account in your app.
- Use https redirect URIs on your own domain, and URL-encode `redirect_uri` in the authorize URL.

## What users see and control

Registration is open, so an app's name is not verified. The consent screen shows the site it redirects to, and says to continue only from an app the user trusts.

Users see every authorized app in **Settings > Connected apps**, with its access, workspace and last use. Revoking there takes effect on the app's next request.

## Public and confidential clients

| | Confidential | Public |
|---|---|---|
| Runs on | Your server | A browser, phone or desktop |
| `token_endpoint_auth_method` | `client_secret_post` or `client_secret_basic` | `none` |
| Secret | Checked on token and revoke calls | Not used |
| PKCE | Required | Required |

A public client gets a `client_secret` in the registration response for compatibility. It is never checked: do not treat it as a secret.

## How it behaves

- Clients cannot be edited or deleted. To change redirect URIs or the logo, register a new client.
- A client secret does not expire. If it leaks, register a new client and move users to it.
- Report a security issue to support@zernio.com.

## Related

- [Consent screen](/oauth/consent-screen)
- [Errors](/oauth/errors)
- [Security overview](/security)