import { UserinfoResponse } from "openid-client"; import { OidcProviderConfig } from "../OidcProviderConfig"; import OidcProfile from "../schemas/OidcProfile"; import OidcTokenSet from "../schemas/OidcTokenSet"; /** * Generic OIDC Provider implementation using openid-client * * Supports both OIDC discovery and manual configuration. * Handles the complete OIDC flow including: * - Authorization URL generation with PKCE * - Token exchange (code → tokens) * - ID token validation * - UserInfo endpoint fetching * - Claims mapping to profile */ export declare class OidcProvider { private config; private issuer; private client; private initialized; constructor(config: OidcProviderConfig); /** * Initialize the provider by discovering or creating the OIDC client * * Uses OIDC discovery if discoveryUrl is provided, otherwise uses * manual endpoint configuration. * * This is async and should be called before using the provider. */ initialize(): Promise; /** * Generate authorization URL with PKCE and nonce * * @param params - Authorization parameters * @returns Authorization URL to redirect user to */ getAuthorizationUrl(params: { state: string; codeVerifier: string; nonce: string; }): Promise; /** * Exchange authorization code for tokens * * Performs the OAuth 2.0 token exchange and validates the ID token. * * @param params - Token exchange parameters * @returns Token set with access token, ID token, and claims */ exchangeCodeForToken(params: { code: string; codeVerifier: string; state: string; nonce: string; }): Promise; /** * Get user profile from UserInfo endpoint * * Fetches additional user claims from the UserInfo endpoint. * Merges with claims from ID token. * * @param accessToken - Access token from token exchange * @returns UserInfo response */ getUserInfo(accessToken: string): Promise; /** * Build complete user profile from tokens * * Combines claims from ID token and UserInfo endpoint, * applies custom claim mapping, and returns normalized profile. * * @param tokenSet - Token set from exchange * @param includeUserInfo - Whether to fetch UserInfo endpoint * @returns Normalized user profile */ buildProfile(tokenSet: OidcTokenSet, includeUserInfo?: boolean): Promise; /** * Ensure provider is initialized before use * * @throws Error if not initialized */ private ensureInitialized; /** * Get issuer metadata (after initialization) * * @returns Issuer metadata */ getIssuerMetadata(): any; } //# sourceMappingURL=OidcProvider.d.ts.map