import { Store } from 'kvs'; import { AdapterFactory, FindAccount, LoadExistingGrant, OidcConfiguration, OidcProvider } from '../types'; export interface OidcProviderFactoryOptions { /** * Base URL of the server. */ baseUrl: string; /** * Path for all requests targeting the OIDC library. */ oidcPath: string; /** * JWT algorithm to use. could be RS256 or ES256. default is RS256. */ jwtAlg?: string; /** * Storage used to store cookie and JWT keys so they can be re-used in case of multithreading. */ store: Store; adapterFactory?: AdapterFactory; findAccount?: FindAccount; loadExistingGrant?: LoadExistingGrant; } /** * Creates an OIDC Provider based on the provided configuration and parameters. * The provider will be cached and returned on subsequent calls. * Cookie and JWT keys will be stored in an internal storage so they can be re-used over multiple threads. * Necessary claims for Solid OIDC interactions will be added. * Routes will be updated based on the `baseUrl` and `oidcPath`. */ export declare class OidcProviderFactory { private readonly config; private readonly options; private readonly baseUrl; private readonly oidcPath; private readonly adapterFactory?; private readonly secretsBucket; private readonly jwtAlg; constructor(config: OidcConfiguration, options: OidcProviderFactoryOptions); createProvider(): Promise; private initConfig; /** * Generates a JWKS using a single JWK. * The JWKS will be cached so subsequent calls return the same key. */ private getOrGenerateJwks; /** * Generates a cookie secret to be used for cookie signing. * The key will be cached so subsequent calls return the same key. */ private getOrGenerateCookieKeys; /** * Adds the necessary claims the to id and access tokens based on the Solid OIDC spec. */ private configureClaims; /** * Sets up all the IDP routes relative to the IDP path. */ private configureRoutes; /** * Pipes library errors to the provided ErrorHandler and ResponseWriter. */ private configureErrors; }