import { CodeBlock } from "../components/CodeBlock"; import { Callout } from "../components/Callout"; export function AuthenticationPage() { return (

Authentication

All /v1/* endpoints require a Bearer JWT in the{" "} Authorization header. Veylant IA validates the token against Keycloak (OIDC) or uses a mock verifier in development mode.

Bearer Token

" \\ -H "Content-Type: application/json" \\ -d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hi"}]}'`} />

Development Mode

When server.env=development and Keycloak is unreachable, the proxy uses a{" "} MockVerifier. Any non-empty Bearer token is accepted. The authenticated user is injected as admin@veylant.dev with admin role and tenant ID{" "} dev-tenant.

Production: Keycloak OIDC Flow

In production, clients obtain a token via the standard OIDC Authorization Code flow:

  1. Redirect user to Keycloak login page
  2. User authenticates; Keycloak redirects back with an authorization code
  3. Exchange code for tokens at the token endpoint
  4. Use the access_token as the Bearer token

JWT Claims

The proxy extracts the following claims from the JWT:

{[ { claim: "sub", source: "Standard JWT", desc: "User ID (UUID)" }, { claim: "email", source: "Standard JWT", desc: "User email" }, { claim: "realm_access.roles", source: "Keycloak extension", desc: "RBAC roles: admin, manager, user, auditor" }, { claim: "veylant_tenant_id", source: "Keycloak mapper", desc: "Tenant UUID" }, { claim: "department", source: "Keycloak user attribute", desc: "Department name for routing rules" }, ].map((row) => ( ))}
Claim Source Description
{row.claim} {row.source} {row.desc}

Pre-configured Test Users

The Keycloak realm export includes these users for testing:

Auth Error Responses

Authentication errors always return OpenAI-format JSON:

); }