javascript - Token Error while using Node Server SDK Opentok -
i using opentok node sdk version 2.2.2 (installing via npm) & client side plugin version 2.2.5.1 . during session.connect() method call , error :
ot.exception :: title: authentication error (1004) msg: invalid token. make sure you're using latest opentok server sdk .
when decoded token(base64) , got :
partner_id=23690372&sig=f52e13ac579649a3531a6040e679fb9bcca04007:session_id=1_mx4ymzy5mdm3mn5-rnjpiep1biawniaxmdoynjoymybqrfqgmjaxnh4xljqzmduxmtvfltz-fg&create_time=1402075583&nonce=0.7174300465267152&role=publisher&expire_time=1402161983
my session id matches 1 above .
using methods , opentok.createsession(function(err, session) { } )
, opentok.generatetoken(session.sessionid)
generate session id , token on server end .
on client side , doing :
session = tb.initsession(tok_api_key,session_id); session.on("streamcreated", function(event) { session.subscribe(event.stream); }); var publisher = tb.initpublisher("broadcast_display", null, function(error) { if (error) { console.log('error initializing publisher', error); } else { console.log('publisher initialized successfully'); } }); session.connect(tok_api_key, token, function(error) { if (error) { console.log(error); } else { session.publish(publisher); } });
not sure problem . ?
update nodejs sdk latest version (v2.2.3) opentok , generate new token.
Comments
Post a Comment