I need to add a self created unique identifier when a user connecting to a session of a OpenTok. So when its connected I can retrieve it back against the connection object.
Is there a way I can do that?
Yes, you can include a 1Kb Data field for each connection, which can be retrieved by other connections in the session. This should not include any PII but be a tag for your app. You can also use the Connection ID in your own app data structures as a reference. See https://tokbox.com/developer/guides/create-token/