Tokbox failed to create session

拟墨画扇 提交于 2020-02-23 06:39:47

问题


[Error: Failed to createSession. Error: An authentication error
occurred: (403) {"code":-1,"message":"Expired token"}]

I was able to create a session just fine on my localhost server, but when I put it in production - which has https - the error occurs.

I am using tokbox with Meteor framework and wraping the function inside a method:

const opentok = new OpenTok(Meteor.settings.public.opentok.apiKey, Meteor.settings.public.opentok.apiSecret);

let createSessionSync = Meteor.wrapAsync(opentok.createSession, opentok); 

回答1:


Rebooting our local development servers did not fix the problem for us when we ran into this issue. It appeared the developer was changing timezone settings on their machine and the system clocks got out of sync with the development server somehow (though the timezone was set to his local time at the moment) but later we realized Docker desktop was creating containers with the wrong date and time. This supports the comment by @Adam Ullman above.

Initially, we solved this by changing the timezone in the Windows system settings. At this point the error went away without restarting the servers. However, see update below:

UPDATE:

The developer ran into the same issue again and timezone changing did not fix it this time. We realized that the Docker container was being created with the wrong time settings (We determined this by logging out the current time in the container). The date in the docker container was a day and several hours behind the computer's time.

It is important to note that deleting the images and restarting the containers alone did not solve the issue. Also, we found that other JWT tokens in the application were also affected not just opentok's.

To solve this, we had to stop Docker Desktop and restart it. This resynchronized all newly created container times to the Windows machine time.




回答2:


reboot the server seem to work but i just don't know why create session is related to token error since i haven't even use the token yet



来源:https://stackoverflow.com/questions/46040347/tokbox-failed-to-create-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!