opentok/opentok-node

An authentication error occurred: (403) {"code":-1,"message":"Invalid issuer format","description":"Invalid issuer format"}

austinyearlykim opened this issue · 0 comments

Hi there!

I received this error and messaged the vonage/opentok team and they pointed me to: https://tokbox.com/developer/rest/#authentication

I sent my code using the SDK and I was shocked to hear that I needed to make a custom request with a JWT token. I thought that the SDK would handle that for me given my API and secret key.

Is there anything blatantly weird with how I'm implementing this method?

My code:

const OpenTok = require('opentok');
const opentok = new OpenTok(process.env.OPENTOK_API_KEY, process.env.OPENTOK_SECRET_KEY);

module.exports = {
    createSession: function() {
        return new Promise((resolve, reject) => {
            opentok.createSession({ mediaMode: 'relayed' }, function(err, session) {
                if (err) reject(err);
                resolve(session);
            });
        });
    }
}

Thank you!