Objective
To ensure that the userId or any other claims passed during the token creation are correctly received in the session events, enable the backend to identify the source of the events. This involves understanding the correct usage of the connection_data claim in the token and addressing the issue where the data property arrives empty in the events.
Applies To
- Video API
Procedure
In Vonage Video session monitoring, it is necessary to identify the source of events. The userId or any other claims passed during token creation should be received in the events, allowing the backend to identify where the event occurs.
When we use a userId key to set our values there's no explicit link between userId and data. To pass that information to the callback response, you must assign the userId to a connection_data claim in the token.
For example:
{
"iat": xxx,
"applicatoinId": xxx,
"jti": xxx,
"role": xxx,
"session_id": xxx,
"scope": xxx,
"connection_data": {yourUserId},
}
Additional Information
https://developer.vonage.com/en/video/guides/session-monitoring#connection-created
https://developer.vonage.com/en/video/guides/create-token#connection-data
Articles in this section
- Identifying the source of events in Vonage Video Session Monitoring
- What is Session Monitoring?
- How to Configure Session Monitoring Callbacks
- What can callback events be used for?
- Is Session monitoring real-time?
- Do you guarantee the callback event delivery?
- What happens to the callback events if my application server goes down?
- How can I test that the Callback URL is working?