Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

question about 'token' and 'userid'

fengyee_y_
Beginner
700 Views

from the SDK_User_Guide.v2.1.1:

peerClient.connect (loginInfo)
This function establishes a connection to the signaling server.
Parameters
loginInfo [in] An objects contains login information. For peer server, this object has two properties: host and token.

Return values
None
Example <script type="text/JavaScript”> var p2p=new Woogeen.PeerClient(); p2p.connect({host:’http://61.152.239.56:8095/’,token:’user1’}); </script>

we can see the loginInfo is host and token. which mean the $('#uid').val() below is the token.

    $('#login').click(function(){
      p2p.connect({host:serverAddress, token:$('#uid').val()});  // Connect to peer server
      $('#uid').prop('disabled',true);
    });

 

PeerClient.inviteWithStream
peerClient.inviteWithStream(peerId, stream, successCallback, failureCallback)
This function invites a remote client to establish a connection for chatting. The stream will be published as soon as the connection is established.
Parameters
peerId [in] Remote user’s ID.

Remarks
This method is intended to be used with Firefox. Please avoid using this method if your application only runs on Chrome.
Example

<script type="text/JavaScript”> var p2p=new Woogeen.PeerClient(); p2p.connect({host:’http://61.152.239.56:8095/’,token:’user1’}); p2p.inviteWithStream(‘user2’,localStream); </script>

my question is : I think the parameter 'token' value used in p2p.connect will be recorded as  user's ID in the peer server, and can be used as the parameter 'peerId' in another peer's p2p.inviteWithStream. Is that right?

 

0 Kudos
4 Replies
Chunbo_H_Intel1
Employee
700 Views

Thanks for the deep dig and feedback. Our engineer of Peer Server will look at this and get back to you later.

0 Kudos
Chunbo_H_Intel1
Employee
700 Views

Yes,you're right about this. Parameter 'token' value used in p2p.connect will be recorded as user's ID by default. We also allow 3rd to customize logical for authentication. Then, token may be different from User’s ID.

0 Kudos
fengyee_y_
Beginner
700 Views

Hi CHUNBO H. thank you very much.

0 Kudos
Chunbo_H_Intel1
Employee
700 Views

OK. Cool. Let us know if you have further issues. Thanks!

0 Kudos
Reply