semblance/node_modules/@azure/msal-react/dist/hooks/useMsalAuthentication.d.ts
2025-12-19 19:26:16 +00:00

18 lines
1.4 KiB
TypeScript
Executable file

import { PopupRequest, RedirectRequest, SsoSilentRequest, InteractionType, AuthenticationResult, AuthError, SilentRequest } from "@azure/msal-browser";
import { AccountIdentifiers } from "../types/AccountIdentifiers.js";
export type MsalAuthenticationResult = {
login: (callbackInteractionType?: InteractionType | undefined, callbackRequest?: PopupRequest | RedirectRequest | SilentRequest) => Promise<AuthenticationResult | null>;
acquireToken: (callbackInteractionType?: InteractionType | undefined, callbackRequest?: SilentRequest | undefined) => Promise<AuthenticationResult | null>;
result: AuthenticationResult | null;
error: AuthError | null;
};
/**
* If a user is not currently signed in this hook invokes a login. Failed logins can be retried using the login callback returned.
* If a user is currently signed in this hook attempts to acquire a token. Subsequent token requests can use the acquireToken callback returned.
* Optionally provide a request object to be used in the login/acquireToken call.
* Optionally provide a specific user that should be logged in.
* @param interactionType
* @param authenticationRequest
* @param accountIdentifiers
*/
export declare function useMsalAuthentication(interactionType: InteractionType, authenticationRequest?: PopupRequest | RedirectRequest | SsoSilentRequest, accountIdentifiers?: AccountIdentifiers): MsalAuthenticationResult;