Register a browser app
1
Register the app
In the console, open Apps → Register app. Under Kind, choose Browser or mobile app.
2
Add your callback page
Under Return addresses, add your callback page, for example
https://app.acme.com/callback. In your Development environment you can use http://localhost:5173/callback.3
Copy the client ID
A browser app has no secret. The credentials screen says: “No secret: this app proves itself with PKCE on every sign-in.”
Registered web origins
Aiveth answers cross-origin (CORS) requests from a browser only when all of these are true:- The path is one of these:
/oauth/token,/oauth/userinfo,/oauth/revoke,/.well-known/openid-configurationand/v1/auth/.well-known/jwks.json. Never the sign-in page or any other API. - The origin belongs to a public app. The origin is the scheme, host and port of one of the return addresses of an active app without a secret. A server app’s return addresses don’t count; a server app never needs the browser to call Aiveth.
- No credentials. Aiveth never sends
Access-Control-Allow-Credentials, so the browser never sends Aiveth’s cookies along. Each call carries its own code or token.
GET and POST, and the allowed request headers are Authorization, Content-Type and DPoP. Preflight answers may be cached for 10 minutes. A request from any other origin gets no CORS headers at all, so the browser blocks it.
There is no separate “allowed origins” list to fill in: the return addresses are the list. A new app’s origin works within about a minute.
Use the React SDK
The React SDK runs the whole flow for you.- Sign-in happens on Aiveth’s page, with code and PKCE.
- Tokens are kept in memory, never in
localStorage. After a reload,signIn()comes straight back while the person is still signed in at Aiveth. - The SDK asks for
offline_accessby default and swaps the refresh token at every use. - An app belongs to one organization, so there is no organization switcher.
Without the SDK
Any OpenID Connect library for browsers works. The token request from a public app sendsclient_id in the form body and no client_secret:
invalid_client.
Security notes
- Keep tokens in memory. Don’t put them in
localStorageorsessionStorage. - Always check
stateon the callback, andnoncein the ID token. - Consider DPoP: it binds the tokens to a key held by the browser, so a copied token is useless. A public app’s refresh tokens are bound too.