authentication module

Namespace to interact with the authentication-specific part of the SDK. * This object is used for starting or completing authentication flows.

Interfaces

AuthenticateParameters
AuthTokenRequest

Functions

authenticate(AuthenticateParameters)

Initiates an authentication request, which opens a new window with the specified settings.

getAuthToken(AuthTokenRequest)

Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.

initialize()
notifyFailure(string, string)

Notifies the frame that initiated this authentication request that the request failed. This function is usable only on the authentication window. This call causes the authentication window to be closed.

notifySuccess(string, string)

Notifies the frame that initiated this authentication request that the request was successful. This function is usable only on the authentication window. This call causes the authentication window to be closed.

registerAuthenticationHandlers(AuthenticateParameters)

Registers the authentication Communication.handlers

Function Details

authenticate(AuthenticateParameters)

Initiates an authentication request, which opens a new window with the specified settings.

function authenticate(authenticateParameters?: AuthenticateParameters)

Parameters

authenticateParameters

@microsoft/teams-js.@microsoft.teams-js.authentication.AuthenticateParameters

getAuthToken(AuthTokenRequest)

Requests an Azure AD token to be issued on behalf of the app. The token is acquired from the cache if it is not expired. Otherwise a request is sent to Azure AD to obtain a new token.

function getAuthToken(authTokenRequest: AuthTokenRequest)

Parameters

authTokenRequest

@microsoft/teams-js.@microsoft.teams-js.authentication.AuthTokenRequest

A set of values that configure the token request.

initialize()

function initialize()

notifyFailure(string, string)

Notifies the frame that initiated this authentication request that the request failed. This function is usable only on the authentication window. This call causes the authentication window to be closed.

function notifyFailure(reason?: string, callbackUrl?: string)

Parameters

reason

string

callbackUrl

string

Specifies the url to redirect back to if the client is Win32 Outlook.

notifySuccess(string, string)

Notifies the frame that initiated this authentication request that the request was successful. This function is usable only on the authentication window. This call causes the authentication window to be closed.

function notifySuccess(result?: string, callbackUrl?: string)

Parameters

result

string

Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives this value in its callback.

callbackUrl

string

Specifies the url to redirect back to if the client is Win32 Outlook.

registerAuthenticationHandlers(AuthenticateParameters)

Registers the authentication Communication.handlers

function registerAuthenticationHandlers(authenticateParameters: AuthenticateParameters)

Parameters

authenticateParameters

@microsoft/teams-js.@microsoft.teams-js.authentication.AuthenticateParameters

A set of values that configure the authentication pop-up.