Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Methods
getPrimary()
Get the primary auth provider.getAuthProviders()
Get all auth provider entries.Auth Modes
FrontMCP supports four authentication modes:Public
mode: 'public' — no authenticationTransparent
mode: 'transparent' — pass-through tokens validated against upstream JWKSLocal
mode: 'local' — built-in OAuth 2.1 authorization serverRemote
mode: 'remote' — OAuth 2.1 server proxying to an upstream IdPrequiresOrchestration (true for local/remote) so adapters know whether to mount OAuth routes.
Properties
requiresOrchestration
Whether the current configuration requires orchestration.detection
Auth provider detection result across apps in scope.Auth Provider Detection
The registry detects auth requirements across the scope hierarchy:Auth in Context Classes
Context classes that extendExecutionContextBase expose two auth surfaces:
Configuration Validation
The registry validates auth configuration:FrontMcpAuth API
The primary auth provider is an abstract base class:this.auth (a
FrontMcpAuthContext) inside execution contexts — see the section below.
Session Integration
Auth integrates with session management:Multi-App Auth
When multiple apps have different auth requirements:FrontMcpAuthContext
TheFrontMcpAuthContext is a request-scoped auth identity object available inside tool, resource, and prompt execution. It provides role, permission, and scope checks extracted from JWT claims.
Properties
| Property | Type | Description |
|---|---|---|
user | FrontMcpAuthUser | Resolved user identity (sub, name, email, picture) |
isAnonymous | boolean | True when sub starts with anon: or is empty |
mode | string | Authentication mode (public, transparent, local, remote) |
sessionId | string | Session identifier (empty string if no session) |
scopes | readonly string[] | OAuth scopes granted to this session |
claims | Readonly<Record<string, unknown>> | Raw JWT claims |
roles | readonly string[] | Resolved roles (via claimsMapping or direct extraction) |
permissions | readonly string[] | Resolved permissions (via claimsMapping or direct) |
Methods
| Method | Signature | Description |
|---|---|---|
hasRole | (role: string) => boolean | Check if user has a specific role |
hasAllRoles | (roles: readonly string[]) => boolean | Check if user has ALL specified roles |
hasAnyRole | (roles: readonly string[]) => boolean | Check if user has at least one role |
hasPermission | (permission: string) => boolean | Check if user has a specific permission |
hasAllPermissions | (permissions: readonly string[]) => boolean | Check if user has ALL specified permissions |
hasAnyPermission | (permissions: readonly string[]) => boolean | Check if user has at least one permission |
hasScope | (scope: string) => boolean | Check if session has a specific OAuth scope |
hasAllScopes | (scopes: readonly string[]) => boolean | Check if session has ALL specified scopes |
hasAnyScope | (scopes: readonly string[]) => boolean | Check if session has at least one scope |
Extension
Add custom typed fields via global interface augmentation:AuthContextPipe functions registered in your server config.
FrontMcpAuthContext vs Authorization:
FrontMcpAuthContext is request-scoped and provides roles, permissions, and scopes from JWT claims. The Authorization interface is transport-scoped and tracks authorized tools, prompts, apps, and provider tokens. Use FrontMcpAuthContext for role/permission checks; use Authorization for tool/app access control.