import { z } from '@frontmcp/lazy-zod'; import { FlowBase, type FlowRunOptions } from '../../common'; /** * Validated OAuth authorization request for orchestrated mode */ declare const oauthAuthorizeRequestSchema: import("@frontmcp/lazy-zod").ZodObject<{ response_type: import("@frontmcp/lazy-zod").ZodLiteral<"code">; client_id: import("@frontmcp/lazy-zod").ZodString; redirect_uri: import("zod").ZodURL; code_challenge: import("@frontmcp/lazy-zod").ZodString; code_challenge_method: import("@frontmcp/lazy-zod").ZodDefault>>; scope: import("@frontmcp/lazy-zod").ZodOptional; state: import("@frontmcp/lazy-zod").ZodOptional; resource: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>; /** * Minimal request for anonymous/default provider mode */ declare const anonymousAuthorizeRequestSchema: import("@frontmcp/lazy-zod").ZodObject<{ redirect_uri: import("zod").ZodURL; state: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>; export type OAuthAuthorizeRequest = z.infer; export type AnonymousAuthorizeRequest = z.infer; declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{ request: import("@frontmcp/lazy-zod").ZodObject<{}, import("zod/v4/core").$loose>; response: import("@frontmcp/lazy-zod").ZodObject<{}, import("zod/v4/core").$loose>; next: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>; declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{ isDefaultAuthProvider: import("@frontmcp/lazy-zod").ZodBoolean; isOrchestrated: import("@frontmcp/lazy-zod").ZodBoolean; allowAnonymous: import("@frontmcp/lazy-zod").ZodBoolean; validatedRequest: import("@frontmcp/lazy-zod").ZodOptional; client_id: import("@frontmcp/lazy-zod").ZodString; redirect_uri: import("zod").ZodURL; code_challenge: import("@frontmcp/lazy-zod").ZodString; code_challenge_method: import("@frontmcp/lazy-zod").ZodDefault>>; scope: import("@frontmcp/lazy-zod").ZodOptional; state: import("@frontmcp/lazy-zod").ZodOptional; resource: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; rawRedirectUri: import("@frontmcp/lazy-zod").ZodOptional; rawState: import("@frontmcp/lazy-zod").ZodOptional; validationErrors: import("@frontmcp/lazy-zod").ZodOptional>; pendingAuthId: import("@frontmcp/lazy-zod").ZodOptional; isIncrementalAuth: import("@frontmcp/lazy-zod").ZodDefault; targetAppId: import("@frontmcp/lazy-zod").ZodOptional; targetToolId: import("@frontmcp/lazy-zod").ZodOptional; existingSessionId: import("@frontmcp/lazy-zod").ZodOptional; priorAuthorizedAppIds: import("@frontmcp/lazy-zod").ZodOptional>; requiresFederatedLogin: import("@frontmcp/lazy-zod").ZodDefault; requiresConsent: import("@frontmcp/lazy-zod").ZodDefault; isCimdClient: import("@frontmcp/lazy-zod").ZodDefault; cimdMetadata: import("@frontmcp/lazy-zod").ZodOptional; token_endpoint_auth_method: import("@frontmcp/lazy-zod").ZodDefault>; grant_types: import("@frontmcp/lazy-zod").ZodDefault>; response_types: import("@frontmcp/lazy-zod").ZodDefault>; client_uri: import("@frontmcp/lazy-zod").ZodOptional; logo_uri: import("@frontmcp/lazy-zod").ZodOptional; jwks_uri: import("@frontmcp/lazy-zod").ZodOptional; jwks: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>>; tos_uri: import("@frontmcp/lazy-zod").ZodOptional; policy_uri: import("@frontmcp/lazy-zod").ZodOptional; scope: import("@frontmcp/lazy-zod").ZodOptional; contacts: import("@frontmcp/lazy-zod").ZodOptional>; software_statement: import("@frontmcp/lazy-zod").ZodOptional; software_id: import("@frontmcp/lazy-zod").ZodOptional; software_version: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; }, import("zod/v4/core").$strip>; declare const outputSchema: import("@frontmcp/lazy-zod").ZodUnion; status: import("@frontmcp/lazy-zod").ZodDefault>; location: import("@frontmcp/lazy-zod").ZodString; headers: import("@frontmcp/lazy-zod").ZodOptional]>]>>>>; cookies: import("@frontmcp/lazy-zod").ZodOptional; domain: import("@frontmcp/lazy-zod").ZodOptional; httpOnly: import("@frontmcp/lazy-zod").ZodDefault; secure: import("@frontmcp/lazy-zod").ZodOptional; sameSite: import("@frontmcp/lazy-zod").ZodOptional>; maxAge: import("@frontmcp/lazy-zod").ZodOptional; expires: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>>>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ kind: import("@frontmcp/lazy-zod").ZodLiteral<"text">; status: import("@frontmcp/lazy-zod").ZodNumber; body: import("@frontmcp/lazy-zod").ZodString; contentType: import("@frontmcp/lazy-zod").ZodDefault; headers: import("@frontmcp/lazy-zod").ZodOptional]>]>>>>; cookies: import("@frontmcp/lazy-zod").ZodOptional; domain: import("@frontmcp/lazy-zod").ZodOptional; httpOnly: import("@frontmcp/lazy-zod").ZodDefault; secure: import("@frontmcp/lazy-zod").ZodOptional; sameSite: import("@frontmcp/lazy-zod").ZodOptional>; maxAge: import("@frontmcp/lazy-zod").ZodOptional; expires: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>>>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ status: import("@frontmcp/lazy-zod").ZodNumber; body: import("@frontmcp/lazy-zod").ZodString; headers: import("@frontmcp/lazy-zod").ZodOptional]>]>>>>; cookies: import("@frontmcp/lazy-zod").ZodOptional; domain: import("@frontmcp/lazy-zod").ZodOptional; httpOnly: import("@frontmcp/lazy-zod").ZodDefault; secure: import("@frontmcp/lazy-zod").ZodOptional; sameSite: import("@frontmcp/lazy-zod").ZodOptional>; maxAge: import("@frontmcp/lazy-zod").ZodOptional; expires: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>>>; kind: import("@frontmcp/lazy-zod").ZodLiteral<"html">; contentType: import("@frontmcp/lazy-zod").ZodDefault>; }, import("zod/v4/core").$strip>]>; declare const plan: { readonly pre: ["parseInput", "validateInput", "checkIfAuthorized"]; readonly execute: ["prepareAuthorizationRequest", "buildAuthorizeOutput"]; readonly post: ["validateOutput"]; }; declare global { interface ExtendFlows { 'oauth:authorize': FlowRunOptions; } } declare const name: "oauth:authorize"; export default class OauthAuthorizeFlow extends FlowBase { private logger; parseInput(): Promise; validateInput(): Promise; checkIfAuthorized(): Promise; prepareAuthorizationRequest(): Promise; buildAuthorizeOutput(): Promise; /** * Render a custom `@AuthUi` slot when one is registered for this scope. * * Mints the per-pending-auth CSRF token (server-owned), persists it onto the * pending authorization record (so the callback can verify it across nodes), * builds the {@link AuthFlowState} via `buildState`, SSRs the registered * component, and responds with the assembled page + CSP / anti-clickjacking * headers. Returns `true` when it handled the slot (caller should `return`), * `false` to fall through to the built-in page (no renderer / build failed). */ private tryRenderCustomSlot; /** * Remote mode (`mode: 'remote'`) auto-federation. * * Builds a federated auth session for the SINGLE mandatory upstream provider * registered by {@link LocalPrimaryAuth.registerRemoteProvider}, starts it * (fresh PKCE + state), persists the session, and redirects straight to the * upstream IdP's authorization endpoint. This reuses the exact federated * machinery the multi-provider local path uses (`/oauth/provider/:id/callback` * then completes the exchange, stores upstream tokens, and mints the FrontMCP * session token whose identity comes from the upstream user) — but skips the * in-tree login page and the provider-selection page entirely. * * No identity is collected in-tree: the federated session is created with an * EMPTY `userInfo` so the minted token's `sub`/`email`/`name` derive solely * from the upstream provider (see the provider-callback flow). */ private startRemoteFederation; validateOutput(): Promise; /** * Enforce the local-AS DCR allowlists (#462) at authorize time. Returns a * human-readable rejection reason, or `undefined` when the request is allowed * (including when no allowlist is configured, or the auth instance does not * expose a DCR registry — e.g. non-local modes). * * - `allowedRedirectUris`: applies to ALL clients (CIMD or not) as an * open-redirect / lateral-movement guard. * - `allowedClientIds`: applies only to non-CIMD client ids; CIMD URLs are * validated by the CIMD layer instead. */ private checkDcrAllowlist; /** * Format Zod errors into human-readable strings */ private formatZodErrors; /** * Respond with OAuth error - redirect if possible, otherwise show error page */ private respondWithError; /** * Render the local login page. * * Honors `auth.login` (Checkpoint 3a): a `login.render` override yields full * custom HTML, `login.fields` extends the built-in form, and otherwise the * unchanged default email/name page is rendered. Rendering is delegated to * the shared `renderLocalLoginPage` helper so the authorize flow and the * callback error re-render stay in sync. */ private renderLoginPage; /** * Render incremental authorization page for a single app using HTMX templates */ private renderIncrementalAuthPage; /** * Render federated login page for multiple auth providers using HTMX templates */ private renderFederatedLoginPage; /** * Render an error page */ private renderErrorPage; } export {}; //# sourceMappingURL=oauth.authorize.flow.d.ts.map