Register an app
1
Open Apps
In the console, open Apps and select Register app. You need the
apps:manage power.2
Choose the kind
- Server app: a web app with its own server. It keeps a secret.
- Browser or mobile app: a single-page or phone app. It can’t keep a secret, so it proves itself with PKCE alone.
- Machine: a service that signs in as itself, with no person. See Machine-to-machine.
3
Add return addresses
Under Return addresses, add one address per line. Aiveth sends people back only to these exact addresses.
4
Copy the credentials
Copy the Client ID, and the Client secret for a server app. The secret is shown once.
Return address rules
- The address must be absolute and must not contain a
#fragment. - It must use https.
httpis allowed only forlocalhost,127.0.0.1or[::1]. - In Production, localhost addresses are refused. Use your Development environment while you build.
- The address in the authorization request must match a registered one exactly.
- For a native app that listens on a loopback address: if you register the loopback address without a port, Aiveth accepts the same address on any port (RFC 8252).
How the flow works
- Your app redirects the browser to
/oauth/authorizewithresponse_type=code, ascopethat includesopenid, and a PKCEcode_challengewithcode_challenge_method=S256. - If the person is not signed in to Aiveth, Aiveth shows your organization’s sign-in page. If they are, Aiveth continues straight away.
- Before it issues a code, Aiveth may show the person a screen: your organization’s terms, a consent notice, or a “Confirm it’s you” step when your app asked for one.
- Aiveth redirects to your return address with
code,stateandiss. - Your server posts the code and the
code_verifierto/oauth/tokenand gets an ID token and an access token.
PKCE with
S256 is required for every app, public or confidential. A request without it gets invalid_request.Rules Aiveth enforces
- One organization per app. An app signs in only people of the organization that registered it. Anyone else gets
access_denied. - Codes are single use. A code lasts two minutes and works once, for the app and return address it was issued to. A second attempt fails, right or wrong.
- The person must still be able to sign in. A suspended person, or a person whose organization is suspended, gets no tokens.
- A turned-off app signs nobody in. In the app’s panel, Turn off stops all sign-ins until the app is registered again.
- Your organization’s sign-in check runs first. If you set up a sign-in check under Developers, Aiveth asks your server before every sign-in and every token refresh.
Scopes
See Tokens and claims for every claim.
Ask the person to confirm it’s them
For a sensitive step, send the person to/oauth/authorize again with one of these:
acr_values=urn:aiveth:acr:2fa: the person must have proved a second factor (a two-step code or a passkey) in this session. A remembered device or a password-only sign-in doesn’t count.max_age=N: the person must have proved it’s them in the lastNseconds.prompt=login: the person must prove it’s them now.prompt=none: never show a screen. Aiveth answerslogin_requiredorinteraction_requiredinstead.
acr is urn:aiveth:acr:2fa when the session proved a second factor, and urn:aiveth:acr:1fa otherwise. auth_time is the time of the latest proof. If the person has no second factor, an acr_values request ends with unmet_authentication_requirements.
Errors in the redirect
When Aiveth can trust the return address, it reports errors there aserror and error_description, with your state:
If the app is unknown or the return address is not registered, Aiveth never redirects. It shows an error page instead.