/** * @author Kevin Nielsen * @author Robert Parker * * @copyright Alert Logic, Inc 2019 */ import { WebAuth } from 'auth0-js'; import Keycloak from 'keycloak-js'; import { AlCabinet } from '../../common'; export declare class AlIdentityProviders { /** * Keycloak and Auth0 client instances */ protected static keycloak: Keycloak; protected static auth0: WebAuth; protected static cachedA0UserInfo: { [accessKey: string]: any; }; protected storage: AlCabinet; protected allIsLost: boolean; constructor(); static inAuth0Workflow(url: string): boolean; static usingTokenInjection(url: string): boolean; /** * This method initializes IdP clients using a heuristic mechanism differentiating auth0 from keycloak. * This allows those clients to initiate and/or respond to redirection based OIDC authentication before the application * itself is bootstrapped and the angular router assumes control of the URL. */ warmup(url?: string): Promise; /** * Retrieve a keycloak authentication interface. */ getKeycloak(): Promise; /** * Retrieve a reference to the Auth0 web auth instance. This code is excluded from unit testing. */ getAuth0Authenticator(): WebAuth; /** * Uses a race to make sure that auth0 session detection doesn't time out -- since a misconfigured client can cause the * promise to hang indefinitely. */ getAuth0SessionToken(authenticator: WebAuth, config: any, timeout?: number): Promise; /** * Calculates the correct auth0 configuration to use. */ getAuth0Config(merge?: any): any; /** * Uses a race to make sure that keycloak initialization doesn't time out -- since a misconfigured client can cause the * promise to hang indefinitely. */ protected innerGetKeyCloak(cloak: Keycloak, timeout?: number): Promise; protected getAuth0UserInfo: (authenticator: WebAuth, userAccessToken: string, callback: (error: any, userInfo: any) => void) => void; /** * Extracts necessary data from the response to auth0's getUserInfo endpoint */ protected extractUserInfo: (identityData: any) => { accountId: string; userId: string; }; /** * Auth0 has a bad habit of generating URLs that are indigestible by @angular/router, so it is necessary to recognize some of * its patterns and correct them. */ protected maybeRewriteBrokenURL(inputURL: string): string | undefined; }