import { IGlobalAuthConfiguration, TokenInfo } from '../../IGlobalAuthConfiguration'; export interface LoginDetails { authorizationUrl: string; healthCheckUrl: string; } /** * This class is used to create a server that listens for an OAuth/OIDC authorization code. * It resolves the code into a {@link TokenInfo} object * * The server will automatically shutdown if: * * - it exchanged the code for a token set * - the authorization server replied with an error * * @example * const exchanger = new TokenExchanger(8080, 'google', {}) * const { authorizationUrl } = exchanger.start() * * console.log(`Visit the following url to login: ${authorizationUrl}`) * * const tokenInfo = await exchanger.getTokens() * // do something with the tokenInfo */ export declare class TokenExchanger { private port; private provider; private authConfig; private redirectUri; private tokens?; constructor(port: number, provider: string, authConfig: IGlobalAuthConfiguration); start(): LoginDetails; getTokens(): Promise; private initAuthContext; private handleCode; }