@microsoft/teams-js
Version:
Microsoft Client SDK for building app for Microsoft hosts
94 lines (92 loc) • 5.74 kB
TypeScript
import { AppId } from '../public';
import * as externalAppAuthentication from './externalAppAuthentication';
/**
* @beta
* @hidden
* Signals to the host to perform SSO authentication for the application specified by the app ID, and then send the authResult to the application backend.
* @internal
* Limited to Microsoft-internal use
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
* @param authTokenRequest Parameters for SSO authentication
* @throws InvokeError if the host encounters an error while authenticating
* @returns A promise that resolves when authentication succeeds and rejects with InvokeError on failure
*/
export declare function authenticateWithSSO(appId: AppId, conversationId: string, authTokenRequest: AuthTokenRequestParametersForCEA): Promise<void>;
/**
* @beta
* @hidden
* Signals to the host to perform authentication using the given authentication parameters and then send the auth result to the application backend.
* @internal
* Limited to Microsoft-internal use
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
* @param authenticateParameters Parameters for the authentication pop-up
* @throws InvokeError if the host encounters an error while authenticating
* @returns A promise that resolves from the application backend and rejects with InvokeError if the host encounters an error while authenticating
*/
export declare function authenticateWithOauth(appId: AppId, conversationId: string, authenticateParameters: externalAppAuthentication.AuthenticatePopUpParameters): Promise<void>;
/**
* @beta
* @hidden
* Signals to the host to perform authentication using the given authentication parameters and then resend the request to the application backend with the authentication result.
* @internal
* Limited to Microsoft-internal use
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
* @param authenticateParameters Parameters for the authentication pop-up
* @param originalRequestInfo Information about the original request that should be resent
* @throws InvokeError if the host encounters an error while authenticating or resending the request
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
*/
export declare function authenticateAndResendRequest(appId: AppId, conversationId: string, authenticateParameters: externalAppAuthentication.AuthenticatePopUpParameters, originalRequestInfo: externalAppAuthentication.IActionExecuteInvokeRequest): Promise<externalAppAuthentication.IActionExecuteResponse>;
/**
* @hidden
* Parameters for SSO authentication. This interface is used exclusively with the externalAppAuthentication APIs
* @internal
* Limited to Microsoft-internal use
*/
export type AuthTokenRequestParametersForCEA = externalAppAuthentication.AuthTokenRequestParameters & {
/**
* Id to complete the request
*/
authId: string;
/**
* Connection name to complete the request
*/
connectionName: string;
};
/**
* @beta
* @hidden
* Signals to the host to perform SSO authentication for the application specified by the app ID and then resend the request to the application backend with the authentication result and originalRequestInfo
* @internal
* Limited to Microsoft-internal use
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
* @param authTokenRequest Parameters for SSO authentication
* @param originalRequestInfo Information about the original request that should be resent
* @throws InvokeError if the host encounters an error while authenticating or resending the request
* @returns A promise that resolves to the IActionExecuteResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
*/
export declare function authenticateWithSSOAndResendRequest(appId: AppId, conversationId: string, authTokenRequest: AuthTokenRequestParametersForCEA, originalRequestInfo: externalAppAuthentication.IActionExecuteInvokeRequest): Promise<externalAppAuthentication.IActionExecuteResponse>;
/**
* @beta
* @hidden
* Checks if the externalAppAuthenticationForCEA capability is supported by the host
* @returns boolean to represent whether externalAppAuthenticationForCEA capability is supported
* @throws Error if {@linkcode app.initialize} has not successfully completed
* @internal
* Limited to Microsoft-internal use
*/
export declare function isSupported(): boolean;
/**
* @hidden
* Checks if the input is valid
* @param appId App ID of the app upon whose behalf Copilot is requesting authentication. This must be a UUID.
* @param conversationId ConversationId To tell the bot what conversation the calls are coming from
* @throws Error if {@linkcode app.initialize} has not successfully completed
* @internal
* Limited to Microsoft-internal use
*/
export declare function validateInput(appId: AppId, conversationId: string): void;