How to use the botframework-connector.JwtTokenValidation function in botframework-connector

To help you get started, we’ve selected a few botframework-connector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / botbuilder-js / libraries / botbuilder-services / lib / botFrameworkAdapter.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            let activity = req.body;
            try {
                // authenticate the incoming request
                var authHeader = req.headers["authorization"] || '';
                yield botframework_connector_1.JwtTokenValidation.assertValidActivity(activity, authHeader, this.credentialsProvider);
            }
            catch (err) {
                console.log(err);
                res.send(401);
                return;
            }
            try {
                // call onReceive delegate
                yield this.onReceive(activity);
                // TODO: Add logic to return 'invoke' response
                res.send(202);
            }
            catch (err) {
                // TODO: Added logic to unpack error
                res.send(500, err.message);
                /*
github microsoft / botbuilder-js / libraries / botbuilder / lib / botFrameworkAdapter.js View on Github external
authenticateRequest(request, authHeader) {
        return botframework_connector_1.JwtTokenValidation.authenticateRequest(request, authHeader, this.credentialsProvider).then(claims => {
            if (!claims.isAuthenticated) {
                throw new Error('Unauthorized Access. Request is not authorized');
            }
        });
    }
    /**