Skip to main content

Sign-in API

EndpointPurpose
POST /api/auth/sign-inStarts sign-in. Body: optional returnPath. Returns authorizationUrl for Microsoft Entra ID.
GET /api/auth/callbackEntra ID returns here. Creates the session and redirects to the return path or the landing page.
POST /api/auth/sign-outEnds the session. Returns 204.
GET /api/meReturns id, displayName, role and organizationId of the signed-in user.

Session​

The aztec_session cookie is Secure, HttpOnly and SameSite=Lax. Every API except sign-in, the callback and the health and feature-flag endpoints returns 401 without a valid session. Each authenticated request carries the user's role and organization node.

Return path​

returnPath must be a path on this site. Absolute URLs and protocol-relative paths are ignored.

Failures​

The callback redirects to /sign-in?error=<code>, keeping returnPath:

CodeMeaning
invalid_credentialsEntra ID rejected the sign-in
organization_inactiveThe user's node or an ancestor is missing or inactive
unavailableEntra ID did not answer within 10 seconds, or returned a service error