Missing information in token

Hello everybody,
I’ve updated openvidu from 2.15 to 2.20. I’ve browser app and native app, the browser app works good but native app that uses REST API to interact with openvidu, has issues.
The issue is related to deprecated method “…/api/tokens” that I also tryed to update to the new “… /api/sessions/<SESSION_ID>/connection”.
The response that I receive missing some parts of token content.
Token that I expect (from DOCS):

"token": "wss://localhost:4443?sessionId=ses_YnDaGYNcd7&token=tok_HCGhiWHWX6hC9el4&role=PUBLISHER&version=2.20.0&coturnIp=localhost&turnUsername=C4LVAW&turnCredential=3hbpdz&webrtcStatsInterval=0",

Token that I receive:

"token": "wss://localhost:4443?sessionId=ses_YnDaGYNcd7&token=tok_HCGhiWHWX6hC9el4",

I don’t know why! I expect to obtain the same token as I used to receive with 2.15.

You shouldn’t expect that :sweat_smile:
The inners of the token are not a fixed API. They are not documented as such and they may change from version to version.

What you are talking about?
I’m basing my software on this refers:

As you can see the connection object contains what I expect. Is there another way to obtain turnCredential and turnUsername for a session?

That reference does define the token property as a String. It is not an object with fixed properties, so you cannot relay on it not changing over time.
Some attributes available in the token in older versions of OpenVidu were moved to the JSON RPC response of “joinRoom” operation: OpenVidu Server RPC protocol - OpenVidu Docs

You are not supposed to need the TURN credentials information associated to an OpenVidu user, but if you want you will have them available at the hidden property Openvidu.iceServers, only after successfully calling Session.connect:


Oh cool! I’ve to rewrite a lot of things of my UWP webrtc library :upside_down_face: