Skip to content

Identity Service REST API ​

The Identity Service is a demo account switching utility for local development. It exposes a small REST API that lets the frontend switch between different pre-seeded users with different roles, so you can preview how the UI looks under various permission scenarios.

This service does not perform real authentication. It does not validate real credentials, connect to an identity provider, or issue production-grade tokens. The token returned by /demo/token is a simple session marker used only for displaying the current account context in the UI; other services do not enforce it.

Local Endpoints ​

EndpointMethodDescription
/healthzGETHealth check
/demo/accountsGETList available demo accounts
/demo/tokenPOSTGet a session token for the selected demo user
/userinfoGETFetch the selected user's profile (requires bearer token from /demo/token)

Base URL: http://127.0.0.1:4320

Quick Start Example ​

ts
// 1. Fetch available demo accounts
const accountsRes = await fetch('http://127.0.0.1:4320/demo/accounts');
const accounts = await accountsRes.json();

// 2. Select an account and get a session token
const tokenRes = await fetch('http://127.0.0.1:4320/demo/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ userId: accounts.defaultAccountId }),
});
const { access_token } = await tokenRes.json();

// 3. Fetch the selected user's profile
const userInfoRes = await fetch('http://127.0.0.1:4320/userinfo', {
  headers: { Authorization: `Bearer ${access_token}` },
});
const userInfo = await userInfoRes.json();

Full API Reference ​