import { AxiosInstance } from 'axios'; /** * The response from the OpenId configuration endpoint. */ export interface OpenIdConfiguration { readonly issuer: string; readonly authorizationEndpoint: string; readonly tokenEndpoint: string; readonly userEndpoint: string; readonly jwksUri: string; readonly scopesSupported: string[]; readonly responseTypesSupported: string[]; readonly tokenEndpointAuthMethodsSupported: string[]; } /** * Returns the OpenId configuration. * * @param client the client to use for making requests * @param domain the domain to request the configuration from */ export declare function getOpenIdConfiguration(client: AxiosInstance, domain: string): Promise; /** * Options for generating an authorization code flow URL. */ export interface AuthorizationCodeFlowOptions { /** * The authorization endpoint to use. */ readonly authorizationEndpoint: string; /** * The state to use. If not specified, a random state will be generated. */ readonly state?: string; /** * The scope(s) to use. */ readonly scope?: string | string[]; /** * The nonce to use. If not specified, a random nonce will be generated. */ readonly nonce?: string; /** * The client ID to use. */ readonly clientId: string; /** * The redirect URI to use. If not specified the default redirect URI configured for the client or flow will be used. */ readonly redirectUri?: string; /** * The provider to use. If not specified, the user will be prompted to select a provider. */ readonly provider?: string; /** * The login hint to use. This is used by Google and Microsoft providers to prefill in the email address. */ readonly loginHint?: string; /** * The prompt to use. This is used by Google and Microsoft providers to prevent account selection when set to 'none'. */ readonly prompt?: string; /** * The flow to use. If not specified, the client configured flow or the default flow will be used. */ readonly flow?: string; } /** * The generated authorization code flow URL with state, nonce and scopes used. */ export interface AuthorizationCodeFlowUrl { readonly url: string; readonly state: string; readonly nonce: string; readonly scopes: string[]; } /** * Generates a URL to start an authorization code flow. * * @param options the options to use when generating the URL */ export declare function getAuthorizationCodeFlowUrl(options: AuthorizationCodeFlowOptions): AuthorizationCodeFlowUrl; /** * Options for generating an authorization code flow URL with PKCE. */ export interface AuthorizationCodeFlowPkceOptions extends AuthorizationCodeFlowOptions { readonly codeVerifier?: string; } /** * The generated authorization code flow URL with state, nonce, scopes and code verifier used. */ export interface AuthorizationCodeFlowUrlPkce extends AuthorizationCodeFlowUrl { readonly codeVerifier: string; } /** * Returns true if the options are for an authorization code flow with PKCE. * * @param url the url to check */ export declare function isAuthorizationCodeFlowPkceUrl(url: AuthorizationCodeFlowUrl): url is AuthorizationCodeFlowUrlPkce; /** * Generates a URL to start an authorization code flow with PKCE. * * @param options the options to use when generating the URL */ export declare function getAuthorizationCodeFlowPkceUrl(options: AuthorizationCodeFlowPkceOptions): AuthorizationCodeFlowUrlPkce; /** * Properties for exchangeAuthorizationCode. */ export interface ExchangeAuthorizationCodeProps { readonly client: AxiosInstance; readonly tokenEndpoint: string; readonly clientId: string; readonly clientSecret: string; readonly code: string; readonly scope: string | string[]; } /** * The result from exchanging an authorization code for an access token. */ export interface ExchangeAuthorizationCodeResult { readonly idToken: string; readonly accessToken: string; readonly expiresIn: number; readonly tokenType: string; readonly scopes: string[]; readonly refreshToken?: string; } /** * Exchanges an authorization code for an access token. * * @param props the properties to use when exchanging the authorization code */ export declare function exchangeAuthorizationCode(props: ExchangeAuthorizationCodeProps): Promise; /** * Properties for exchangeAuthorizationCodePkce. */ export interface ExchangeAuthorizationCodePkceProps { readonly client: AxiosInstance; readonly tokenEndpoint: string; readonly clientId: string; readonly codeVerifier: string; readonly code: string; readonly scope: string | string[]; } /** * Exchanges an authorization code for an access token with PKCE. * * @param props the properties to use when exchanging the authorization code */ export declare function exchangeAuthorizationCodePkce(props: ExchangeAuthorizationCodePkceProps): Promise; /** * Properties for exchangeClientCredentials. */ export interface ExchangeClientCredentialsProps { readonly client: AxiosInstance; readonly tokenEndpoint: string; readonly clientId: string; readonly clientSecret: string; readonly scope: string | string[]; } /** * The result from exchanging client credentials for an access token. */ export interface ExchangeClientCredentialsResult { readonly accessToken: string; readonly expiresIn: number; readonly tokenType: string; readonly scopes: string[]; } /** * Exchanges client credentials for an access token. * * @param props the properties to use when exchanging the client credentials */ export declare function exchangeClientCredentials(props: ExchangeClientCredentialsProps): Promise; /** * Properties for exchangeRefreshToken. */ export interface ExchangeRefreshTokenProps { readonly client: AxiosInstance; readonly tokenEndpoint: string; readonly clientId: string; readonly refreshToken: string; } /** * The result from exchanging a refresh token for an access token. */ export interface ExchangeRefreshTokenResult { readonly accessToken: string; readonly expiresIn: number; readonly tokenType: string; readonly scopes: string[]; readonly refreshToken: string; } /** * Refreshes an access token using a refresh token. * * @param props the properties to use when refreshing the access token */ export declare function exchangeRefreshToken(props: ExchangeRefreshTokenProps): Promise; //# sourceMappingURL=oidc-functions.d.ts.map