-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyBotFrameworkAuthentication.js
40 lines (34 loc) · 1.33 KB
/
MyBotFrameworkAuthentication.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const {
CloudAdapter,
ConversationState,
MemoryStorage,
UserState,
ConfigurationBotFrameworkAuthentication
} = require('botbuilder');
class MyBotFrameworkAuthentication extends ConfigurationBotFrameworkAuthentication
{
/**
* Authenticate Bot Framework Protocol requests to Skills.
*
* @param authHeader The http auth header received in the skill request.
* @returns {Promise<ClaimsIdentity>} A [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity).
*/
authenticateChannelRequest(authHeader) {
const result = super.authenticateChannelRequest(authHeader);
return result;
}
/**
* Validate Bot Framework Protocol requests.
*
* @param activity The inbound Activity.
* @param authHeader The HTTP auth header.
* @returns {Promise<AuthenticateRequestResult>} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult).
*/
authenticateRequest(activity, authHeader) {
return super.authenticateRequest(activity,authHeader).then(function(data){
const claimIdentity = data.claimsIdentity;
return data;
} );
}
}
module.exports.MyBotFrameworkAuthentication = MyBotFrameworkAuthentication;