I'm experiencing an issue where in once execute end point is being run, It returns an error name: 'JsonWebTokenError', message: 'jwt malformed', I already have an environment variable using the JWT Signing Secret of my installed package.

This is a sample JWT Signing Secret


This is my

Execute method

exports.execute = function (req, res) {//console.log("execute function!!!");

console.log("EXECUTE HAS BEEN RUN");
console.log('KEY - > ' + process.env.JWT_KEY);
JWT(req.body, process.env.JWT_KEY, (err, decoded) => {

    // verification error -> unauthorized request
    if (err) {
        return res.status(401).end();

    if (decoded && decoded.inArguments && decoded.inArguments.length > 0) {
        console.log('##### decoded ####=>', decoded);

        // decoded in arguments

    } else {
        console.error('inArguments invalid.');
        return res.status(400).end();

console.log("end execute function!!!");


 This is my Decoder

    'use strict';

module.exports = (body, secret, cb) => {
    if (!body) {
        return cb(new Error('invalid jwtdata'));

    require('jsonwebtoken').verify(body.toString('utf8'), secret, {
        algorithm: 'HS256'
    }, cb);

btw I'm using azure as a host for my web app.


Another question for my config.json is it allright if I don't have any inArguments since I can get the value from the incoming data associated with the entry event

1 Answer 1


1) Try to add body parser to your express server:

const app = express();
   type: 'application/jwt'

2) Regarding getting data from entry event source check my answer here: Get the name of the Data Extension you are working with : Custom Activity

  • Thanks! @RosHaitovich
    – imajmdf
    Sep 23, 2019 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.