Authentication

Login, logout, current principal.

All paths are relative to the base path /api/v1 (same origin as the UI). Authentication, roles, pagination and the error format are described in the overview; the types are on the page Data types.

OperationRequestPermission
Login options (public)GET /auth/configpublic
Start the OIDC authorization code flow (PKCE) - browser redirectGET /auth/loginpublic
OIDC redirect URI - creates the session and redirects to the UIGET /auth/callbackpublic
Local login (only when auth.devLogin.enabled, i.e. dev mode)POST /auth/dev-loginpublic
Break-glass sign-in of the bootstrap admin (only while auth.bootstrapAdmin is active)POST /auth/bootstrap-loginpublic
End the sessionPOST /auth/logoutread (viewer)
Current principal with effective permissionsGET /auth/meread (viewer)

Login options (public)

GET /api/v1/auth/config

Operation getAuthConfig. Permission public. No login is needed.

Responses

StatusDescriptionContent typeType
200Login optionsapplication/jsonAuthConfigInfo

Start the OIDC authorization code flow (PKCE) - browser redirect

GET /api/v1/auth/login

Operation startOidcLogin. Permission public. No login is needed.

Parameters

NameInTypeRequiredDescription
redirectquerystringnoUI path to return to after login (must start with “/”). Default /.

Responses

StatusDescriptionContent typeType
302Redirect to the identity provider--
404Not found (code not_found)application/problem+jsonProblem

OIDC redirect URI - creates the session and redirects to the UI

GET /api/v1/auth/callback

Operation oidcCallback. Permission public. No login is needed.

Parameters

NameInTypeRequiredDescription
codequerystringyes
statequerystringyes

Responses

StatusDescriptionContent typeType
302Redirect to the UI (session and CSRF cookies set). On failure the redirect goes to /login?error=access_denied (no role mapped for the user) or /login?error=oidc_error.--
401Not authenticated (code unauthorized)application/problem+jsonProblem

Local login (only when auth.devLogin.enabled, i.e. dev mode)

POST /api/v1/auth/dev-login

Operation devLogin. Permission public. No login is needed.

Request body

Content type application/json, required. Type: DevLoginRequest.

{
  "username": "string",
  "password": "string"
}

Responses

StatusDescriptionContent typeType
200Logged in; session and CSRF cookies setapplication/jsonMe
401Not authenticated (code unauthorized)application/problem+jsonProblem
404Not found (code not_found)application/problem+jsonProblem
429Too many login attempts for this client address or user name (code too_many_requests, header Retry-After)application/problem+jsonProblem

Break-glass sign-in of the bootstrap admin (only while auth.bootstrapAdmin is active)

POST /api/v1/auth/bootstrap-login

Operation bootstrapLogin. Permission public. No login is needed.

Request body

Content type application/json, required. Type: BootstrapLoginRequest.

{
  "username": "string",
  "password": "string",
  "token": "string"
}

Responses

StatusDescriptionContent typeType
200Signed in; session and CSRF cookies setapplication/jsonMe
400Invalid request (code bad_request)application/problem+jsonProblem
401Not authenticated (code unauthorized)application/problem+jsonProblem
404Not found (code not_found)application/problem+jsonProblem
429Too many sign-in attempts for this client address or for the bootstrap admin (code too_many_requests, header Retry-After)application/problem+jsonProblem

End the session

POST /api/v1/auth/logout

Operation logout. Permission read (lowest role: viewer).

Parameters

NameInTypeRequiredDescription
X-CSRF-TokenheaderstringnoRequired for cookie-authenticated mutating requests (value of cookie myriarch_csrf).

Responses

StatusDescriptionContent typeType
204Logged out--
401Not authenticated (code unauthorized)application/problem+jsonProblem

Current principal with effective permissions

GET /api/v1/auth/me

Operation getMe. Permission read (lowest role: viewer).

Responses

StatusDescriptionContent typeType
200Current principalapplication/jsonMe
401Not authenticated (code unauthorized)application/problem+jsonProblem