UNPKG

@project-sunbird/ext-framework-server

Version:
41 lines (40 loc) 1.42 kB
import { IAuthProvider } from './IAuthProvider'; import { NextFunction } from 'express'; import { Request, Response } from 'express-serve-static-core'; export interface IKeycloakConfig { 'store': any; 'realm': string; 'resource': string; 'realm-public-key'?: string; 'auth-server-url': string; 'ssl-required'?: string; 'use-resource-role-mappings'?: Boolean; 'enable-cors'?: Boolean; 'cors-max-age'?: Number; 'cors-allowed-methods'?: string; 'cors-exposed-headers'?: string; 'bearer-only'?: Boolean; 'enable-basic-auth'?: Boolean; 'expose-token': Boolean; 'credentials'?: any; 'connection-pool-size'?: Number; 'disable-trust-manager'?: Boolean; 'allow-any-hostname'?: Boolean; 'truststore'?: string; 'truststore-password'?: string; 'client-keystore'?: string; 'client-keystore-password'?: string; 'client-key-password'?: string; 'token-minimum-time-to-live'?: Number; 'min-time-between-jwks-requests'?: Number; 'public-key-cache-ttl'?: Number; 'redirect-rewrite-rules'?: any; 'middleware-options': any; } export declare class KeycloakAuthProvider implements IAuthProvider { private connection; private options; configure(options: IKeycloakConfig): void; authenticate(req: Request, res: Response, next: NextFunction): void; protect(req: Request, res: Response, next: NextFunction): void; }