Invalid authentication information passed in Session.connect

Official OpenTok Server-Side libraries

Invalid authentication information passed in Session.connect

Postby chadg » Mon Dec 05, 2011 10:15 pm

Hi,

I am having a similar issue to another user where I am getting this error message when trying to set the data on the connection with JSON. If I just send a basic string (e.g. "John Smith") it works.

I am using the Java API, and did just get the latest, which did not solve the problem.

Error:
["[ERROR] opentok: TB.exception :: title: Authentication Error msg: Invalid authentication information passed in Session.connect(). Failed to parse the token: Failed to parse token: too many values to unpack errorCode: 1004"]

Here is the full request params that were built:
session_id=2_MX4xMDcwNjgxfjE5Mi4xNjguMS42fjIwMTEtMTItMDYgMDU6MTE6NTguNzgyNDUzKzAwOjAwfjAuNTc2ODg3MjE5MzMxfg&create_time=1323148324&nonce=-1603659114&role=publisher&connection_data='{"fName":"fn2","lName":"fn2","role":"ORGANIZER"}'

Any suggestions?

Thanks!
Chad
Was this post helpful? (0)
chadg
 
Posts: 12
Joined: Wed Nov 09, 2011 11:45 pm
Thumbs Up: 0

Re: Invalid authentication information passed in Session.con

Postby jtsai » Tue Dec 06, 2011 12:30 am

Are you setting the connection data in the javascript, or with the generation of the token? Can you copy and paste a token that gives this error?

I think the problem lies with the token not encoding the colons to pass into the URL. (the ":" should be "%3A"). But I'm not sure where this is happening without more details.

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4974
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 192

Re: Invalid authentication information passed in Session.con

Postby HEIS » Tue Dec 06, 2011 10:38 am

I continue to receive the Exception Error 1004. I used the plug and play with the cut paste js script that I received when I signed in and this the constant error message.
Exception 1004: Connection to server rejected unable to join session with invalid token. I was actually able to attach the plug n play version...the one on the start button page...which presents the code after you submit your e-mail... and it worked fine for a couple of hours. However, at some point it disappeared... Therefore, I went to the registration to receive my API as I thought that may be the issue. I completed that portion of the sign-up, however, after receiving my secret and all...applying everything.. The Plug n Play still does not work. Is it possible that this streaming video chat has to be on an independent server? As I am on a shared server with my hosting company. I was wondering is there a work around...
Was this post helpful? (0)
HEIS
 
Posts: 2
Joined: Tue Dec 06, 2011 10:16 am
Thumbs Up: 0

Re: Invalid authentication information passed in Session.con

Postby jtsai » Wed Dec 07, 2011 12:40 pm

HEIS wrote:I continue to receive the Exception Error 1004. I used the plug and play with the cut paste js script that I received when I signed in and this the constant error message.
Exception 1004: Connection to server rejected unable to join session with invalid token. I was actually able to attach the plug n play version...the one on the start button page...which presents the code after you submit your e-mail... and it worked fine for a couple of hours. However, at some point it disappeared... Therefore, I went to the registration to receive my API as I thought that may be the issue. I completed that portion of the sign-up, however, after receiving my secret and all...applying everything.. The Plug n Play still does not work. Is it possible that this streaming video chat has to be on an independent server? As I am on a shared server with my hosting company. I was wondering is there a work around...


Hi HEIS,

I'm not really to sure why your embed would stop working after a while. Whats the embed code that was provided to you? Do you have other shared hosting sites to try it out on?

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4974
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 192

Re: Invalid authentication information passed in Session.con

Postby chadg » Wed Dec 07, 2011 8:40 pm

I am setting the data with the generation of the token.

sdk.generate_token(sessionId, RoleConstants.PUBLISHER, null, jsonString);

T1==cGFydG5lcl9pZD0xMDcwNjgxJnNpZz05OWE4M2Q3N2FkM2NmN2I0MmI5MjNmNmE5NGQ5NTJiMjYxZmU1NWE0OnNlc3Npb25faWQ9Ml9NWDR4TURjd05qZ3hmakU1TWk0eE5qZ3VNUzQyZmpJd01URXRNVEl0TURnZ01ETTZNekE2TlRNdU9URTVOVGczS3pBd09qQXdmakF1TkRrNU1ESTBPVGt3TkRrM2ZnJmNyZWF0ZV90aW1lPTEzMjMzMTUxMDAmbm9uY2U9LTIxMDgyMTE3NTAmcm9sZT1wdWJsaXNoZXImY29ubmVjdGlvbl9kYXRhPSd7ImZOYW1lIjoiZm4yIiwibE5hbWUiOiJmbjIiLCJyb2xlIjoiT1JHQU5JWkVSIn0n

Thanks!
Chad
Was this post helpful? (0)
chadg
 
Posts: 12
Joined: Wed Nov 09, 2011 11:45 pm
Thumbs Up: 0

Re: Invalid authentication information passed in Session.con

Postby jtsai » Wed Dec 07, 2011 9:39 pm

chadg wrote:I am setting the data with the generation of the token.

sdk.generate_token(sessionId, RoleConstants.PUBLISHER, null, jsonString);

T1==cGFydG5lcl9pZD0xMDcwNjgxJnNpZz05OWE4M2Q3N2FkM2NmN2I0MmI5MjNmNmE5NGQ5NTJiMjYxZmU1NWE0OnNlc3Npb25faWQ9Ml9NWDR4TURjd05qZ3hmakU1TWk0eE5qZ3VNUzQyZmpJd01URXRNVEl0TURnZ01ETTZNekE2TlRNdU9URTVOVGczS3pBd09qQXdmakF1TkRrNU1ESTBPVGt3TkRrM2ZnJmNyZWF0ZV90aW1lPTEzMjMzMTUxMDAmbm9uY2U9LTIxMDgyMTE3NTAmcm9sZT1wdWJsaXNoZXImY29ubmVjdGlvbl9kYXRhPSd7ImZOYW1lIjoiZm4yIiwibE5hbWUiOiJmbjIiLCJyb2xlIjoiT1JHQU5JWkVSIn0n

Thanks!
Chad


When you build your json string, replace ":" with "%3A" and see if that works. The library is supposed to automatically convert those, but it doesn't look like its doing it.

So, from your example, the full param request should look like:
Code: Select all
session_id=2_MX4xMDcwNjgxfjE5Mi4xNjguMS42fjIwMTEtMTItMDYgMDU6MTE6NTguNzgyNDUzKzAwOjAwfjAuNTc2ODg3MjE5MzMxfg&create_time=1323148324&nonce=-1603659114&role=publisher&connection_data='{"fName"%3A"fn2","lName"%3A"fn2","role"%3A"ORGANIZER"}'


John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4974
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 192

Re: Invalid authentication information passed in Session.con

Postby HEIS » Sat Dec 10, 2011 3:49 pm

Thank you John,

Yes, I do have another site that I can test is on. Should the embed work without setting the token and sessionId? I was just wondering as this seems to be an important aspect to the process. :?
Was this post helpful? (0)
HEIS
 
Posts: 2
Joined: Tue Dec 06, 2011 10:16 am
Thumbs Up: 0

Re: Invalid authentication information passed in Session.con

Postby janine » Sat Dec 10, 2011 10:54 pm

Yes, the embed should work without worrying about generating tokens and sessions. Let us know if it works on your other site.
Was this post helpful? (0)
janine
 
Posts: 1681
Joined: Thu May 05, 2011 7:10 pm
Thumbs Up: 20

Re: Invalid authentication information passed in Session.con

Postby chadg » Sun Dec 11, 2011 9:37 pm

Changing the colon to %3a worked.

Thanks!
Chad
Was this post helpful? (0)
chadg
 
Posts: 12
Joined: Wed Nov 09, 2011 11:45 pm
Thumbs Up: 0


Return to Supported Server API (PHP, Java, Ruby, Python)



Who is online

Users browsing this forum: No registered users and 1 guest

cron