Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

question about 'token' and 'userid'

fengyee_y_
Beginner
144 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
144 Views

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

Chunbo_H_Intel1
Employee
144 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.

fengyee_y_
Beginner
144 Views

Hi CHUNBO H. thank you very much.

Chunbo_H_Intel1
Employee
144 Views

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

Reply