/** * ------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. * See License in the project root for license information. * ------------------------------------------------------------------------------------------- */ import { AuthenticationProviderOptions } from '@microsoft/microsoft-graph-client/lib/es/IAuthenticationProviderOptions'; import { Configuration } from '@azure/msal-browser'; import { Msal2Provider } from '@microsoft/mgt-msal2-provider'; declare global { interface Window { nativeInterface: any; } } /** * Enumeration to define if we are using get or post * * @export * @enum {string} */ export declare enum HttpMethod { /** * Will use Get and the querystring */ GET = "GET", /** * Will use Post and the request body */ POST = "POST" } /** * Interface to define the configuration when creating a TeamsMsal2Provider * * @export * @interface TeamsMsal2Config */ export interface TeamsMsal2Config { /** * The app clientId * * @type {string} * @memberof TeamsMsal2Config */ clientId: string; /** * The relative or absolute path of the html page that will handle the authentication * * @type {string} * @memberof TeamsMsal2Config */ authPopupUrl: string; /** * The scopes to use when authenticating the user * * @type {string[]} * @memberof TeamsMsal2Config */ scopes?: string[]; /** * Additional Msal configurations options to use * See Msal.js documentation for more details * * @type {Configuration} * @memberof TeamsMsal2Config */ msalOptions?: Configuration; /** * The relative or absolute path to the token exchange backend service * * @type {string} * @memberof TeamsMsal2Config */ ssoUrl?: string; /** * Should the provider display a consent popup automatically if needed * * @type {string} * @memberof TeamsMsal2Config */ autoConsent?: boolean; /** * Should the provider display a consent popup automatically if needed * * @type {AuthMethod} * @memberof TeamsMsal2Config */ httpMethod?: HttpMethod; } /** * Enables authentication of Single page apps inside of a Microsoft Teams tab * * @deprecated in favor of TeamsFxProvider. * @export * @class TeamsMsal2Provider * @extends {Msal2Provider} */ export declare class TeamsMsal2Provider extends Msal2Provider { /** * Gets whether the Teams provider can be used in the current context * (Whether the app is running in Microsoft Teams) * * @readonly * @static * @memberof TeamsMsal2Provider */ static get isAvailable(): boolean; /** * Optional entry point to the teams library * If this value is not set, the provider will attempt to use * the microsoftTeams global variable. * * @static * @memberof TeamsMsal2Provider */ static get microsoftTeamsLib(): any; static set microsoftTeamsLib(value: any); /** * Name used for analytics * * @readonly * @memberof IProvider */ get name(): string; /** * Handle all authentication redirects in the authentication page and authenticates the user * * @static * @returns * @memberof TeamsMsal2Provider */ static handleAuth(): Promise; protected clientId: string; private static _localStorageParametersKey; private static _sessionStorageLoginInProgress; private static _sessionStorageLogoutInProgress; private teamsContext; private _authPopupUrl; private _msalOptions; private _ssoUrl; private _needsConsent; private _autoConsent; private _httpMethod; constructor(config: TeamsMsal2Config); /** * Opens the teams authentication popup to the authentication page * * @returns {Promise} * @memberof TeamsMsal2Provider */ login(): Promise; /** * sign out user * * @returns {Promise} * @memberof MsalProvider */ logout(): Promise; /** * Returns an access token that can be used for making calls to the Microsoft Graph * * @param {AuthenticationProviderOptions} options * @returns {Promise} * @memberof TeamsMsal2Provider */ getAccessToken(options: AuthenticationProviderOptions): Promise; /** * Makes sure we can get an access token before considered logged in * * @returns {Promise} * @memberof TeamsMsal2Provider */ private internalLogin; /** * Get a token via the Teams SDK * * @returns {Promise} * @memberof TeamsMsal2Provider */ private getClientToken; /** * Retrieves the Teams context */ private getTeamsContext; private unhandledFetchError; } //# sourceMappingURL=TeamsMsal2Provider.d.ts.map