Share via


SkillValidation.AuthenticateChannelToken Method

Definition

Validates that the incoming Auth Header is a token sent from a bot to a skill or from a skill to a bot.

public static System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity> AuthenticateChannelToken (string authHeader, Microsoft.Bot.Connector.Authentication.ICredentialProvider credentials, Microsoft.Bot.Connector.Authentication.IChannelProvider channelProvider, System.Net.Http.HttpClient httpClient, string channelId, Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration authConfig);
static member AuthenticateChannelToken : string * Microsoft.Bot.Connector.Authentication.ICredentialProvider * Microsoft.Bot.Connector.Authentication.IChannelProvider * System.Net.Http.HttpClient * string * Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration -> System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity>
Public Shared Function AuthenticateChannelToken (authHeader As String, credentials As ICredentialProvider, channelProvider As IChannelProvider, httpClient As HttpClient, channelId As String, authConfig As AuthenticationConfiguration) As Task(Of ClaimsIdentity)

Parameters

authHeader
String

The raw HTTP header in the format: "Bearer [longString]".

credentials
ICredentialProvider

The user defined set of valid credentials, such as the AppId.

channelProvider
IChannelProvider

The channelService value that distinguishes public Azure from US Government Azure.

httpClient
HttpClient

Authentication of tokens requires calling out to validate Endorsements and related documents. The HttpClient is used for making those calls. Those calls generally require TLS connections, which are expensive to setup and teardown, so a shared HttpClient is recommended.

channelId
String

The ID of the channel to validate.

authConfig
AuthenticationConfiguration

The authentication configuration.

Returns

A ClaimsIdentity instance if the validation is successful.

Applies to