SkillValidation.AuthenticateChannelToken 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
驗證傳入的驗證標頭是從 Bot 傳送至技能或從技能傳送至 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)
參數
- authHeader
- String
格式為“Bearer [longString]” 的原始 HTTP 標頭。
- credentials
- ICredentialProvider
使用者定義的有效認證集,例如 AppId。
- channelProvider
- IChannelProvider
channelService 值,可區分公用 Azure 與美國政府 Azure。
- httpClient
- HttpClient
憑證認證需要呼叫以驗證背書及相關文件。 HttpClient 就是用來打這些電話的。 這些通話通常需要 TLS 連線,且設定和拆除成本高昂,因此建議使用共用的 HttpClient。
- channelId
- String
要驗證之通道的標識碼。
- authConfig
- AuthenticationConfiguration
驗證組態。
傳回
如果驗證成功,則為 ClaimsIdentity 實例。