@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
25 lines (24 loc) • 1.29 kB
TypeScript
import AuthManager, { AuthManagerConfiguration } from "./AuthManager";
/**
* Microsoft-specific implementation of AuthManager
* Handles Microsoft-specific OAuth flows and token management
* @template TPolicyNames - Enum type for policy keys
*/
declare class MsAuthManager<TPolicyNames extends string = string> extends AuthManager<TPolicyNames> {
private hasApiScopes;
/**
* Creates a new instance of MsAuthManager
* @param {AuthManagerConfiguration} config - Configuration object for the MsAuthManager
*/
constructor(config: string extends TPolicyNames ? Omit<AuthManagerConfiguration<TPolicyNames>, "policies"> | AuthManagerConfiguration<TPolicyNames> : AuthManagerConfiguration<TPolicyNames>);
/**
* Gets a valid access token for the specified scope set
* If no API scopes were configured and requesting the default scope set,
* returns the ID token instead of the access token
* @param {string} [scopeSetName="default"] - The name of the scope set to get the token for
* @returns {Promise<string>} A valid access token or ID token
* @throws {Error} If not authenticated, token refresh fails, or scope set doesn't exist
*/
getAccessToken(scopeSetName?: string): Promise<string>;
}
export default MsAuthManager;