EmulatorValidation.AuthenticateEmulatorToken Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AuthenticateEmulatorToken(String, ICredentialProvider, IChannelProvider, HttpClient, String) |
Validate the incoming Auth Header as a token sent from the Bot Framework Emulator. |
AuthenticateEmulatorToken(String, ICredentialProvider, IChannelProvider, HttpClient, String, AuthenticationConfiguration) |
Validate the incoming Auth Header as a token sent from the Bot Framework Emulator. |
AuthenticateEmulatorToken(String, ICredentialProvider, IChannelProvider, HttpClient, String)
Validate the incoming Auth Header as a token sent from the Bot Framework Emulator.
public static System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity> AuthenticateEmulatorToken (string authHeader, Microsoft.Bot.Connector.Authentication.ICredentialProvider credentials, Microsoft.Bot.Connector.Authentication.IChannelProvider channelProvider, System.Net.Http.HttpClient httpClient, string channelId);
static member AuthenticateEmulatorToken : string * Microsoft.Bot.Connector.Authentication.ICredentialProvider * Microsoft.Bot.Connector.Authentication.IChannelProvider * System.Net.Http.HttpClient * string -> System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity>
Public Shared Function AuthenticateEmulatorToken (authHeader As String, credentials As ICredentialProvider, channelProvider As IChannelProvider, httpClient As HttpClient, channelId As String) 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.
Returns
A valid ClaimsIdentity.
Remarks
A token issued by the Bot Framework will FAIL this check. Only Emulator tokens will pass.
Applies to
AuthenticateEmulatorToken(String, ICredentialProvider, IChannelProvider, HttpClient, String, AuthenticationConfiguration)
Validate the incoming Auth Header as a token sent from the Bot Framework Emulator.
public static System.Threading.Tasks.Task<System.Security.Claims.ClaimsIdentity> AuthenticateEmulatorToken (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 AuthenticateEmulatorToken : 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 AuthenticateEmulatorToken (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 valid ClaimsIdentity.
Remarks
A token issued by the Bot Framework will FAIL this check. Only Emulator tokens will pass.