Going to production
A checklist for launching an app built on the SDK. The right server and App ID, return URLs, HTTPS and CSP, minimal permissions, server checks, error handling, and monitoring.
Most launch problems are configuration: the wrong App ID, a return URL that still says localhost, a permission nobody registered. Work through this list before you announce your app. Each item links to the page that explains it.
The checklist
Environment and registration
- The app exists on the production server. Apps are per server: the test server's App ID does not work in production. Register the app in the console and use its App ID. See Testing and debugging.
-
issueris production, or left at the default. The default ishttps://api.unet.ovh/oidc. Remove anyissuerthat points at the test server. - The production return URL is registered. It must equal
redirectUriexactly: scheme, host, port, path, trailing slash. Add the production address in the console; removelocalhostaddresses you no longer need. - The app has a name people recognise. It is shown on the permission screen.
- Website apps: the domain is verified. An app whose domain is not verified is marked as unverified on the permission screen.
Page and transport
- The whole site is served over HTTPS, and
httpredirects to it. - A content security policy is in place and allows
connect-src https://api.unet.ovh. See Security checklist. - Storage is the one you meant.
sessionis the default;localonly with a strict policy. See Sessions and storage. - The SDK version is pinned in your lockfile and noted in your release notes.
Permissions
- Scopes are the minimum. Every permission in
scopesis used by a feature that exists. Registered permissions matchscopes: a new app is held to what it registered. See Permissions. -
offline_accessis requested only if the person should stay signed in beyond an hour. - A missing permission is handled (
InsufficientScope): the feature is hidden or asks for the permission.
Your server
- Tokens are verified on the server with
verifyAccessTokenorverifyIdToken, never trusted from the browser. See Verify on your server. - Users are keyed by
sub. - The App Secret is only on the server, in your secret store, not in the repository.
- A thrown verification error answers 503, not 200 or 401 (it means "unknown").
Behaviour at the edges
-
SessionExpiredis handled as signed out, not logged as an error. People remove apps; sessions end. See Error handling. -
RateLimitedis handled: no retry loops, a message to the person. -
AccessDeniedis handled: someone who pressed Deny lands somewhere sensible. - A refresh that fails because of the network does not sign people out. The SDK keeps the tokens; make sure your UI does not treat
NetworkErroras signed out. - Text from UNET is escaped, and links built from it check the scheme. See Security checklist.
People and privacy
- Your privacy text says what you keep: the person's
sub,usernameand display name, and anything else you store. UNET gives you no email address. - You can delete a person's data when they ask, and when they remove your app.
- People know how to remove your app. They do it in their UNET settings under Connected apps. Removing it revokes your tokens at once.
Operations
- You can see problems. Count the rate of
SessionExpired,RateLimitedandApiErrorby status, and the time sign-in takes. Do not log tokens or whole requests. If you useonTracein production, record onlysdk,statusandms. - You know the limits that apply to your app and what happens when you reach them. See Call the UNET API.
- You know how to turn the app off and rotate the secret if you must. See Security checklist.
What changes between test and production
| Test | Production | |
|---|---|---|
Server (issuer) | https://test-api.unet.ovh/oidc | https://api.unet.ovh/oidc (default) |
| App ID | the one registered on the test server | the one registered on production |
| Return URLs | http://localhost:PORT/... allowed | your https address |
| Accounts and data | test accounts | real people |
| Permissions | whatever you are trying | the minimum your features need |
Keep the two App IDs in configuration and select by environment, so the same build cannot sign in against the wrong server.
After launch
- Watch the changelog. The SDK is 0.x. Read the changelog and the versioning policy before you upgrade, and upgrade in a branch with your tests.
- Add permissions deliberately. When a feature needs a new one, register it, request it with
prompt: "consent", and expect that some people say no.