@shane32/msoauth
Version:
A React library for Azure AD authentication with PKCE (Proof Key for Code Exchange) flow support. This library provides a secure and easy-to-use solution for implementing Azure AD authentication in React applications, with support for both API and Microso
49 lines (48 loc) • 1.75 kB
TypeScript
/**
* OpenID Connect provider configuration endpoints
*/
export interface OpenIDConfiguration {
/** URL of the authorization endpoint */
authorization_endpoint: string;
/** URL of the token endpoint */
token_endpoint: string;
/** URL of the end session endpoint */
end_session_endpoint: string;
/** The issuer identifier for the OpenID provider */
issuer: string;
}
/**
* Manages OpenID Connect configuration by fetching and caching the configuration
* from the provider's well-known endpoint.
*/
declare class OpenIDConfigurationManager {
private authority;
/** Promise for ongoing configuration fetch request */
private configPromise;
/** Cached configuration to avoid repeated fetches */
private cachedConfig;
/**
* Creates a new instance of OpenIDConfigurationManager
* @param {string} authority - Base URL of the OpenID Connect provider
*/
constructor(authority: string);
/**
* Fetches the OpenID configuration from the provider's well-known endpoint
* @returns {Promise<OpenIDConfiguration>} The OpenID configuration
* @throws {Error} If the configuration fetch fails
*/
private fetchOpenIDConfiguration;
/**
* Gets the OpenID configuration, using cached values if available
* Implements a caching strategy to avoid unnecessary network requests
* @returns {Promise<OpenIDConfiguration>} The OpenID configuration
* @throws {Error} If the configuration fetch fails
*/
getConfiguration(): Promise<OpenIDConfiguration>;
/**
* Clears the cached configuration
* Forces the next getConfiguration call to fetch fresh data
*/
clearCache(): void;
}
export default OpenIDConfigurationManager;