ChannelValidation module
Functions
| authenticate |
Validate the incoming Auth Header as a token sent from the Bot Framework Service. A token issued by the Bot Framework emulator will FAIL this check. |
| authenticate |
Validate the incoming Auth Header as a token sent from the Bot Framework Service. A token issued by the Bot Framework emulator will FAIL this check. |
| validate |
Validate the ClaimsIdentity to ensure it came from the channel service. |
Function Details
authenticateChannelToken(string, ICredentialProvider, string, AuthenticationConfiguration)
Validate the incoming Auth Header as a token sent from the Bot Framework Service. A token issued by the Bot Framework emulator will FAIL this check.
function authenticateChannelToken(authHeader: string, credentials: ICredentialProvider, channelId: string, authConfig?: AuthenticationConfiguration): Promise<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.
- channelId
-
string
The ID of the channel to validate.
- authConfig
- AuthenticationConfiguration
The authentication configuration.
Returns
Promise<ClaimsIdentity>
A valid ClaimsIdentity.
authenticateChannelTokenWithServiceUrl(string, ICredentialProvider, string, string, AuthenticationConfiguration)
Validate the incoming Auth Header as a token sent from the Bot Framework Service. A token issued by the Bot Framework emulator will FAIL this check.
function authenticateChannelTokenWithServiceUrl(authHeader: string, credentials: ICredentialProvider, serviceUrl: string, channelId: string, authConfig?: AuthenticationConfiguration): Promise<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.
- serviceUrl
-
string
The ServiceUrl Claim value that must match in the identity.
- channelId
-
string
The ID of the channel to validate.
- authConfig
- AuthenticationConfiguration
The authentication configuration.
Returns
Promise<ClaimsIdentity>
A valid ClaimsIdentity.
validateIdentity(ClaimsIdentity, ICredentialProvider)
Validate the ClaimsIdentity to ensure it came from the channel service.
function validateIdentity(identity: ClaimsIdentity, credentials: ICredentialProvider): Promise<ClaimsIdentity>
Parameters
- identity
- ClaimsIdentity
The identity to validate
- credentials
- ICredentialProvider
The user defined set of valid credentials, such as the AppId.
Returns
Promise<ClaimsIdentity>
A valid ClaimsIdentity.