ExtendedUserTokenProvider interface

Warning

This API is now deprecated.

Use UserTokenClient instead.

Interface for User Token OAuth Single Sign On and Token Exchange APIs for BotAdapters

Extends

Methods

exchangeToken(TurnContext, string, string, TokenExchangeRequest)

Performs a token exchange operation such as for single sign-on.

exchangeToken(TurnContext, string, string, TokenExchangeRequest, CoreAppCredentials)

Performs a token exchange operation such as for single sign-on.

getAadTokens(TurnContext, string, string[], CoreAppCredentials)

Signs the user out with the token server.

getSignInLink(TurnContext, string, CoreAppCredentials)

Gets a signin link from the token server that can be sent as part of a SigninCard.

getSignInResource(TurnContext, string)

Get the raw signin resource to be sent to the user for signin for a connection name.

getSignInResource(TurnContext, string, string, string)

Get the raw signin resource to be sent to the user for signin for a connection name.

getSignInResource(TurnContext, string, string, string, CoreAppCredentials)

Get the raw signin resource to be sent to the user for signin for a connection name.

getUserToken(TurnContext, string, string, CoreAppCredentials)

Retrieves the OAuth token for a user that is in a sign-in flow.

signOutUser(TurnContext, string, string, CoreAppCredentials)

Signs the user out with the token server.

Inherited Methods

getTokenStatus(TurnContext, string, string, any)

Retrieves the token status for each configured connection for the given user, using the bot's AppCredentials.

Method Details

exchangeToken(TurnContext, string, string, TokenExchangeRequest)

Performs a token exchange operation such as for single sign-on.

function exchangeToken(context: TurnContext, connectionName: string, userId: string, tokenExchangeRequest: TokenExchangeRequest): Promise<TokenResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

userId

string

The user id that will be associated with the token.

tokenExchangeRequest

TokenExchangeRequest

The exchange request details, either a token to exchange or a uri to exchange.

Returns

Promise<TokenResponse>

exchangeToken(TurnContext, string, string, TokenExchangeRequest, CoreAppCredentials)

Performs a token exchange operation such as for single sign-on.

function exchangeToken(context: TurnContext, connectionName: string, userId: string, tokenExchangeRequest: TokenExchangeRequest, appCredentials: CoreAppCredentials): Promise<TokenResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

userId

string

The user id that will be associated with the token.

tokenExchangeRequest

TokenExchangeRequest

The exchange request details, either a token to exchange or a uri to exchange.

appCredentials
CoreAppCredentials

Returns

Promise<TokenResponse>

getAadTokens(TurnContext, string, string[], CoreAppCredentials)

Signs the user out with the token server.

function getAadTokens(context: TurnContext, connectionName: string, resourceUrls: string[], appCredentials?: CoreAppCredentials): Promise<[key: string]: TokenResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

resourceUrls

string[]

appCredentials
CoreAppCredentials

Returns

Promise<[key: string]: TokenResponse>

Gets a signin link from the token server that can be sent as part of a SigninCard.

function getSignInLink(context: TurnContext, connectionName: string, appCredentials?: CoreAppCredentials): Promise<string>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

appCredentials
CoreAppCredentials

Returns

Promise<string>

getSignInResource(TurnContext, string)

Get the raw signin resource to be sent to the user for signin for a connection name.

function getSignInResource(context: TurnContext, connectionName: string): Promise<SignInUrlResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

Returns

Promise<SignInUrlResponse>

getSignInResource(TurnContext, string, string, string)

Get the raw signin resource to be sent to the user for signin for a connection name.

function getSignInResource(context: TurnContext, connectionName: string, userId: string, finalRedirect?: string): Promise<SignInUrlResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

userId

string

The user id that will be associated with the token.

finalRedirect

string

The final URL that the OAuth flow will redirect to.

Returns

Promise<SignInUrlResponse>

getSignInResource(TurnContext, string, string, string, CoreAppCredentials)

Get the raw signin resource to be sent to the user for signin for a connection name.

function getSignInResource(context: TurnContext, connectionName: string, userId: string, finalRedirect?: string, appCredentials?: CoreAppCredentials): Promise<SignInUrlResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

userId

string

The user id that will be associated with the token.

finalRedirect

string

The final URL that the OAuth flow will redirect to.

appCredentials
CoreAppCredentials

Returns

Promise<SignInUrlResponse>

getUserToken(TurnContext, string, string, CoreAppCredentials)

Retrieves the OAuth token for a user that is in a sign-in flow.

function getUserToken(context: TurnContext, connectionName: string, magicCode?: string, appCredentials?: CoreAppCredentials): Promise<TokenResponse>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

magicCode

string

(Optional) Optional user entered code to validate.

appCredentials
CoreAppCredentials

Returns

Promise<TokenResponse>

signOutUser(TurnContext, string, string, CoreAppCredentials)

Signs the user out with the token server.

function signOutUser(context: TurnContext, connectionName: string, userId?: string, appCredentials?: CoreAppCredentials): Promise<void>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

connectionName

string

Name of the auth connection to use.

userId

string

User id of user to sign out.

appCredentials
CoreAppCredentials

Returns

Promise<void>

Inherited Method Details

getTokenStatus(TurnContext, string, string, any)

Retrieves the token status for each configured connection for the given user, using the bot's AppCredentials.

function getTokenStatus(context: TurnContext, userId: string, includeFilter?: string, oAuthAppCredentials?: any): Promise<any[]>

Parameters

context
TurnContext

Context for the current turn of conversation with the user.

userId

string

The user Id for which token status is retrieved.

includeFilter

string

Comma separated list of connection's to include. Blank will return token status for all configured connections.

oAuthAppCredentials

any

The app credentials for OAuth.

Returns

Promise<any[]>

Inherited From IUserTokenProvider.getTokenStatus