lib/oauth.js
function (req, cb) {
        if (req.soajs && req.soajs.tenantOauth && req.soajs.tenantOauth.secret && req.soajs.tenant && req.soajs.tenant.id) {
            let secret = req.soajs.tenantOauth.secret;
            let tenantId = req.soajs.tenant.id.toString();

            let basic = Auth.generate(tenantId, secret);
            return cb(null, basic);
        }
        else
            return cb({"code": 406, "msg": req.soajs.config.errors[406]});
    }
function (req, cb) {
        if (req.soajs && req.soajs.tenantOauth && req.soajs.tenantOauth.secret && req.soajs.tenant && req.soajs.tenant.id) {
            let secret = req.soajs.tenantOauth.secret;
            let tenantId = req.soajs.tenant.id.toString();

            let basic = Auth.generate(tenantId, secret);
            return cb(null, basic);
        }
        else
            return cb({"code": 406, "msg": req.soajs.config.errors[406]});
    }
Generate the the authorization value