API referenceProject API

Authentication (SSO)

The single sign-on entry point and the browser session endpoints. The recommended way to log members in.

SSO-aware entry point (/auth/sso/authorize) and the cookie-backed browser endpoints (/auth/sso/session, /auth/sso/sessions, /auth/sso/logout). After a member logs in once via Discord, every subsequent project login on the same browser skips the Discord screen. Recommended default for new integrations.

GET/api/auth/sso/authorize

Recommended default for new "Login with Micro Club" buttons. Same query contract as GET /auth/authorize. If the caller has a valid mcid_sso cookie, the Discord OAuth bounce is skipped and the browser is redirected straight to the platform's redirect_uri with ?code=...&state=.... Otherwise this falls back to the existing /auth/authorize flow (Discord OAuth).

Use GET /auth/authorize instead when you need to force a fresh Discord consent.

Add prompt=none for a silent login check from a project backend: with a valid cookie it behaves as above, and without one it redirects back to redirect_uri with error=login_required instead of going to Discord. client_id, redirect_uri and server_id are validated first, so an untrusted redirect_uri still gets a 400 and never a redirect.

Authentication: None, this endpoint is public.

Parameters

NameInTypeRequiredDescription
client_idquerystring (uuid)yesProject ID (UUID) identifying the client application
redirect_uriquerystringyesURI to redirect back to after authentication. Must be whitelisted for the project.
server_idquerystringyesDiscord server ID to verify membership against
statequerystringyesOpaque state value passed through to the redirect. Use for CSRF protection.
promptquery"none"noSilent login check, only honoured by GET /auth/sso/authorize. With none, a browser without a valid mcid_sso cookie is redirected back with error=login_required instead of being sent to Discord.

Responses

StatusDescriptionBody
200object
302Redirects to Discord OAuth (no SSO yet), back to the platform with a fresh callback code (SSO hit), or with prompt=none and no SSO, back to the platform with error=login_required.

Open in Swagger (opens in a new tab)

Destroy the global SSO session (log out everywhere)

POST/api/auth/sso/logout

Reads the mcid_sso httpOnly cookie, destroys the SSO session, cascades to every project session for the same member, and clears the cookie. Idempotent - succeeds even if the cookie is missing.

Authentication: None, this endpoint is public.

Responses

StatusDescriptionBody
204SSO session destroyed and cookie cleared.

Open in Swagger (opens in a new tab)

Get current SSO session status

GET/api/auth/sso/session

Reads the mcid_sso httpOnly cookie set after Discord login and returns the authenticated member. Returns 401 with { authenticated: false } when the cookie is missing or expired.

Authentication: None, this endpoint is public.

Responses

StatusDescriptionBody
200SsoSessionStatusDto
401SsoSessionUnauthenticatedDto

Open in Swagger (opens in a new tab)

List active project sessions under the current SSO session

GET/api/auth/sso/sessions

Returns one entry per active (non-expired) project session for the member identified by the mcid_sso cookie. Token material is never returned. Returns 401 when the SSO cookie is missing or expired.

Authentication: None, this endpoint is public.

Responses

StatusDescriptionBody
200SsoProjectSessionListDto
401Missing or expired SSO cookie.

Open in Swagger (opens in a new tab)

Schemas

SsoMemberDto schema

FieldTypeRequiredDescription
avatarstring or nullno
discordIdstringyesDiscord user ID (same as id in MCID)
idstringyes
usernamestringyes

SsoProjectSessionDto schema

FieldTypeRequiredDescription
createdAtstring (date-time)yes
expiresAtstring (date-time)yes
lastUsedAtstring (date-time) or nullnoLast time this project session was used. Not currently tracked on sessions, so returns createdAt as a best-effort fallback.
projectIdstringyes
projectNamestringyes
serverIdstring or nullno

SsoProjectSessionListDto schema

FieldTypeRequiredDescription
sessionsarray of SsoProjectSessionDtoyes

SsoSessionStatusDto schema

FieldTypeRequiredDescription
authenticatedbooleanyes
expiresAtstring (date-time)yes
memberSsoMemberDtoyes

SsoSessionUnauthenticatedDto schema

FieldTypeRequiredDescription
authenticatedbooleanyes

Source: apps/api/openapi.json.

On this page