import { Validator } from './helpers/xml'; import * as LoginResponse from './login-response'; import { Certificate } from './helpers/certificate'; export interface IDPOptions { id: string; redirectLoginUrl: string; postLoginUrl: string; signature: { algorithm: 'sha256' | 'sha512'; allowedCertificates: string[]; }; } export interface SPOptions { id: string; singleLogoutUrl: string; assertionUrl: string; signature: Certificate[]; encryption?: Certificate[]; } export interface Preferences { signLoginRequests: boolean; strictTimeCheck: boolean; attributeMapping: { [attribute: string]: string; }; nameIdFormat: string; addNameIdPolicy: boolean; forceAuthenticationByDefault: boolean; } export interface OptionsWithoutMetadata { preferences?: Partial; getUUID: () => string | Promise; idp: IDPOptions; sp: SPOptions; } export interface OptionsWithMetadata { preferences?: Partial; getUUID: () => string | Promise; idp: string; sp: SPOptions; } /** * Data to be inserted into a hidden form and auto-submitted to use the HTTP-POST binding. */ export interface LoginRequestPostFormData { action: string; fields: { SAMLRequest: string; RelayState?: string; }; } interface SAMLProviderOptions { XSDs: { protocol: Validator; metadata: Validator; }; preferences: Preferences; identityProvider: IDPOptions; serviceProvider: SPOptions; getUUID: () => string | Promise; } export default class SAMLProvider { static create(options: OptionsWithoutMetadata | OptionsWithMetadata): Promise; readonly XSDs: SAMLProviderOptions['XSDs']; readonly preferences: SAMLProviderOptions['preferences']; private readonly identityProvider; private readonly serviceProvider; private readonly getUUID; private constructor(); buildLoginRequestRedirectURL(relayState?: string, forceAuthentication?: boolean): Promise; buildLoginRequestPostFormData(relayState?: string, forceAuthentication?: boolean): Promise; parseLoginResponse(query: { [key: string]: any; }): Promise<{ response: LoginResponse.LoginResponse; relayState: string; }>; getMetadata(): string; private buildLoginRequestXML; } export {};