opentok/opentok-node

Error calling createSession

garystorey opened this issue · 6 comments

When calling createSession from the Server SDK, the call is returning the following error:
Error: Failed to createSession. Error: An authentication error occurred: (403) {"code":-1,"message":"Invalid signature","description":"Invalid signature"}

The code hasn't changed recently so I am wondering what might have caused this.

@garystorey Hmm, can you verify that the JWT token for the request is valid at jwt.io?
You can console.log the JWT token here: https://github.com/opentok/opentok-node/blob/master/lib/client.js#L54

I'm not sure about the JWT; I am making a call like to createSession. Here is the simplified code:
`
const OpenTok = require('opentok');
const ot = new OpenTok( cfg.opentok.api_key, process.env.OPENTOK_SECRET);

// this call returns an error
ot.createSession({ mediaMode: 'routed' }, (err,session) => {
// handle error simply displays the error in the console.
if (handleError(res,err)) {
//success. do stuff here
}
});
`
The session object is null and the error object is populated with the error above,
From package.json, we are using "opentok": "^2.8.0"

tha same proble... did you managed to solve it?

@garystorey @nachourpi Apologies for the delay on this. Can you confirm that you are using the correct project api key and secret combination?

Sorry for the late response... I was pulled off of this project for a while. I was using a non-matching secret and api key. My issue is resolved.

Sorry for the late response... I was pulled off of this project for a while. I was using a non-matching secret and api key. My issue is resolved.

Hi, how do I get the api key and secret key, or are they the same as api and session id?