BotFrameworkAuthentication class

Represents a Cloud Environment used to authenticate Bot Framework Protocol network calls within this environment.

Methods

authenticateChannelRequest(string)

Authenticate Bot Framework Protocol request to Skills.

authenticateRequest(Activity, string)

Validate Bot Framework Protocol requests.

authenticateStreamingRequest(string, string)

Validate Bot Framework Protocol requests.

createBotFrameworkClient()

Creates a BotFrameworkClient for calling Skills.

createConnectorFactory(ClaimsIdentity)

Creates a ConnectorFactory that can be used to create ConnectorClients that can use credentials from this particular Cloud Environment.

createUserTokenClient(ClaimsIdentity)

Creates the appropriate UserTokenClient instance.

getOriginatingAudience()

Gets the originating audience from Bot OAuth scope.

Method Details

authenticateChannelRequest(string)

Authenticate Bot Framework Protocol request to Skills.

function authenticateChannelRequest(authHeader: string): Promise<ClaimsIdentity>

Parameters

authHeader

string

The HTTP auth header in the skill request.

Returns

Promise<ClaimsIdentity>

A ClaimsIdentity.

authenticateRequest(Activity, string)

Validate Bot Framework Protocol requests.

function authenticateRequest(activity: Activity, authHeader: string): Promise<AuthenticateRequestResult>

Parameters

activity

Activity

The inbound Activity.

authHeader

string

The HTTP auth header.

Returns

An AuthenticateRequestResult.

authenticateStreamingRequest(string, string)

Validate Bot Framework Protocol requests.

function authenticateStreamingRequest(authHeader: string, channelIdHeader: string): Promise<AuthenticateRequestResult>

Parameters

authHeader

string

The HTTP auth header.

channelIdHeader

string

The channel ID HTTP header.

Returns

An AuthenticateRequestResult.

createBotFrameworkClient()

Creates a BotFrameworkClient for calling Skills.

function createBotFrameworkClient(): BotFrameworkClient

Returns

A BotFrameworkClient.

createConnectorFactory(ClaimsIdentity)

Creates a ConnectorFactory that can be used to create ConnectorClients that can use credentials from this particular Cloud Environment.

function createConnectorFactory(claimsIdentity: ClaimsIdentity): ConnectorFactory

Parameters

claimsIdentity
ClaimsIdentity

The inbound Activity's ClaimsIdentity.

Returns

A ConnectorFactory.

createUserTokenClient(ClaimsIdentity)

Creates the appropriate UserTokenClient instance.

function createUserTokenClient(claimsIdentity: ClaimsIdentity): Promise<UserTokenClient>

Parameters

claimsIdentity
ClaimsIdentity

The inbound Activity's ClaimsIdentity.

Returns

Promise<UserTokenClient>

An UserTokenClient.

getOriginatingAudience()

Gets the originating audience from Bot OAuth scope.

function getOriginatingAudience(): string

Returns

string

The originating audience.