Authentication
IdentityScribe supports three authentication methods across all channels and the monitoring endpoint.
Quick start
Section titled “Quick start”Two environment variables enable authentication with Bearer tokens:
SCRIBE_AUTH_ENABLED=trueSCRIBE_AUTH_ISSUER=https://auth.example.com/realms/mycompanyOr in HOCON with named providers:
auth { enabled = true providers { default { issuer = "https://auth.example.com/realms/mycompany" audiences = ["scribe"] } }}How authentication works
Section titled “How authentication works”How requests are authenticated
Clients authenticate by sending an HTTP Authorization header. Scribe supports two header schemes:
| Scheme | Header format | What Scribe receives |
|---|---|---|
| Bearer | Authorization: Bearer <jwt> | A pre-obtained JWT token |
| Basic | Authorization: Basic <base64> | Username and password (base64-encoded) |
The authentication method determines how Scribe validates what it receives:
| Method | Header | Validation |
|---|---|---|
| Bearer tokens | Bearer | Verify JWT signature via JWKS, check claims |
| ROPC | Basic | Exchange credentials with IdP for JWT, then verify |
| LDAP bind | Basic | Search for user DN, bind to LDAP to verify password |
Scribe tries Bearer first. If no Bearer token is present, it falls back to Basic auth methods (ROPC or LDAP, depending on configuration).
Choosing a method
Section titled “Choosing a method”| Your client… | Use | Why |
|---|---|---|
| Already has a JWT from your IdP | Bearer | Fastest — no network calls per request |
| Sends username/password, needs OAuth claims | ROPC | Trades credentials for JWT, gets roles/scopes from IdP |
| Sends username/password, no IdP available | LDAP | Direct validation against directory |
Use Bearer tokens unless clients can’t obtain tokens themselves.
MCP channel
Section titled “MCP channel”The MCP channel uses the same auth: OAuth Bearer first, with Basic (ROPC or LDAP bind) as fallback when tokens are unavailable. See MCP Channel — Authentication for client-specific setup and MCP Cursor callback issues when OAuth callbacks fail.
Authentication methods
Section titled “Authentication methods”Bearer tokens (recommended)
Section titled “Bearer tokens (recommended)”Clients obtain a JWT from your identity provider and include it in requests:
GET /api/users HTTP/1.1Authorization: Bearer eyJhbGciOiJSUzI1...- Client authenticates with IdP (browser redirect, client credentials, etc.)
- IdP issues a signed JWT
- Client sends JWT to Scribe in the Authorization header
- Scribe verifies signature against IdP’s public keys (cached from JWKS)
- Scribe checks expiration, audience, and issuer claims
No per-request calls to the IdP. After the initial JWKS fetch, validation happens locally.
JWT verification with JWKS
ROPC (Resource Owner Password Credentials)
Section titled “ROPC (Resource Owner Password Credentials)”Clients send username and password via HTTP Basic auth. Scribe exchanges those credentials with your IdP for a JWT, then validates the token.
GET /api/users HTTP/1.1Authorization: Basic YWxpY2U6c2VjcmV0Password-based token exchange
Configuration:
auth { enabled = true methods = [bearer, ropc]
providers { default { issuer = "https://auth.example.com" audiences = ["scribe"] client-id = "scribe" client-secret = ${SCRIBE_AUTH_CLIENT_SECRET} } }
ropc { scopes = "openid profile email" }}LDAP bind
Section titled “LDAP bind”Clients send username and password via HTTP Basic auth. Scribe searches for the user’s DN, then binds to LDAP with the provided password.
GET /api/users HTTP/1.1Authorization: Basic YWxpY2U6c2VjcmV0No IdP required. Authentication happens directly against your LDAP directory. LDAP-only auth does not require OIDC provider credentials — you do not need to configure auth.providers, issuer, client-id, or client-secret.
Direct password verification against directory
Configuration:
auth { enabled = true methods = [ldap]
ldap { base = "ou=users,dc=example,dc=com" bind-attribute = "uid" filter = "(objectClass=person)" }}LDAP connection settings (server URL, bind-dn, bind-password) are inherited from the root ldap {} configuration. Configure a service account there — Scribe uses it to search for user DNs before validating passwords. See the auth reference for pattern-based lookup, LDAP role mapping, and attribute configuration.
Access rules
Section titled “Access rules”Access rules let you control who can do what. Rules evaluate top-to-bottom; first match wins. If nothing matches, access is denied.
Out of the box, Scribe allows authenticated requests and denies anonymous access. Prometheus and health endpoints are exceptions — they allow anonymous access for scrapers and Kubernetes.
auth.rules = [ { id = "admin-bypass", action = allow, where = "subject.roles = admin" } { id = "schema-public", action = allow, where = "request.channel = graphql and request.operation = schema" } { action = allow, where = "subject.authenticated = true and request.operation in [search, lookup]" }]Each rule takes action (allow/deny), an optional where filter expression, and an optional id for log/trace visibility.
Common patterns
Section titled “Common patterns”Authenticated access with public health checks:
auth.rules = [ { action = allow, where = "request.path startswith /health" } { action = allow, where = "subject.authenticated = true" }]Restrict history queries to admins:
auth.rules = [ { action = allow, where = "subject.roles = admin" } { action = deny, where = "request.operation = history" } { action = allow, where = "subject.authenticated = true" }]LDAP writes require admin role:
channels.ldap.auth.rules = [ { action = allow, where = "subject.roles = admin" } { action = deny, where = "request.operation = modify or request.operation = delete" } { action = allow, where = "subject.authenticated = true" }]Related
Section titled “Related”- Auth configuration reference — All settings: access rule attributes, identity model, LDAP role mapping, credential caching, JWT validation, browser sessions, multi-provider setup, channel overrides
- Production checklist — TLS, network isolation, token validation hardening
- Networking — TLS and socket configuration
- Error Handling — Auth error codes and response formats