Skip to main content

Authentication API

Local login/logout, session identity, and the pre-login config probe.

This page lists 6 endpoints (OpenAPI tag auth). It is generated from openapi.json; see the REST API overview for authentication, CSRF and error conventions.

MethodPathOperation idNotes
POST/api/admin/impersonateimpersonate_start
GET/api/auth/configauth_config
POST/api/auth/impersonation/exitimpersonate_exit
POST/api/auth/loginlogin
POST/api/auth/logoutlogout
GET/api/auth/meme

POST /api/admin/impersonate​

Operation id: impersonate_start. Auth: Session cookie and X-Egret-CSRF header. Forbidden (403): Not a platform admin, already impersonating, or target is an admin. A target holding a NON-admin platform role (a data_steward, say) is permitted here: the overlay this endpoint writes is platform-scoped, and the caller already holds strictly more than the target.

Request body (application/json): StartImpersonation

FieldTypeRequiredDescription
target_user_idstringyes
reasonstringyes
passwordstring, nullablenoRequired for a local-auth admin (step-up). OIDC admins re-auth via OIDC (Task 8).
StatusMeaning
200Impersonation started; the session now resolves to the target
400Bad target / empty reason
401Not authenticated, or wrong step-up password
403Not a platform admin, already impersonating, or target is an admin. A target holding a NON-admin platform role (a data_steward, say) is permitted here: the overlay this endpoint writes is platform-scoped, and the caller already holds...
409OIDC admin: re-authenticate at authorize_url, then the callback creates the overlay
500Internal error

GET /api/auth/config​

Operation id: auth_config. Auth: None (public).

Response 200 (application/json): AuthConfig

FieldTypeRequiredDescription
oidc_enabledbooleanyes
StatusMeaning
200Pre-login capability probe (is OIDC enabled?)
500Internal error

POST /api/auth/impersonation/exit​

Operation id: impersonate_exit. Auth: Session cookie and X-Egret-CSRF header.

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Impersonation ended; the session returns to the admin
401Not authenticated
500Internal error

POST /api/auth/login​

Operation id: login. Auth: None (public).

Request body (application/json): LoginRequest

FieldTypeRequiredDescription
emailstringyes
passwordstringyes

Response 200 (application/json): MeResponse

FieldTypeRequiredDescription
user_idstringyes
emailstringyes
platform_rolesstring[]yes
permissionsstring[]yes
impersonatingImpersonationDtono
StatusMeaning
200Logged in; sets session + CSRF cookies
401Invalid email or password
429Too many login attempts
500Internal error

POST /api/auth/logout​

Operation id: logout. Auth: None (public).

Response 200 (application/json): Ack

FieldTypeRequiredDescription
okbooleanyes
StatusMeaning
200Session revoked; clears session + CSRF cookies
500Internal error

GET /api/auth/me​

Operation id: me. Auth: Session cookie.

Response 200 (application/json): MeResponse

FieldTypeRequiredDescription
user_idstringyes
emailstringyes
platform_rolesstring[]yes
permissionsstring[]yes
impersonatingImpersonationDtono
StatusMeaning
200The authenticated caller's identity + permissions
401Not authenticated
500Internal error