WebRTC Remote Access fails with 400 Bad Request — XSRF-TOKEN=undefined in request

Hi everyone,

I’m currently testing the WebRTC Webcam Plugin ( GitHub - Cumulocity-IoT/cumulocity-webrtc-webcam-plugin: A plugin that allows to access the webcam of cumulocity devices via webrtc ) in the Device Management app.

When I try to open a device webcam session, the WebSocket connection to the Remote Access service fails with a 400 Bad Request.

Here’s the relevant request:

GET wss://our-tenant-url/service/remoteaccess/client/4711676997/configurations/1?token=Basic dXXXXXX...&XSRF-TOKEN=undefined
Status: 400 Bad Request

I noticed that the query parameter contains XSRF-TOKEN=undefined, and I’m wondering if that might be the reason.

It seems like the front-end (or plugin) is appending the XSRF token automatically, but the value is not set — literally “undefined”.

My questions:

  • Is this caused by a misconfiguration on my tenant or device setup, or

  • Is this a bug in the Remote Access plugin / WebRTC integration that incorrectly appends the token?

Additional info:

  • Browser: Firefox 144.0 on macOS

  • The ICE/STUN phase completes successfully — this only happens at the WebSocket connect stage.

Any insights would be greatly appreciated!

Thanks in advance.
Benjamin

Hi @benjamin.ruoff,

This might be an issue with the WebRTC plugin.. As a workaround could you give it a try by configuring your tenant for OAuth (OAI-Secure) instead of Basic auth? Basic settings - Cumulocity documentation

Regards,
Tristan

I’ve also added a fix that should be available soon in version 3.0.1 of the plugin.

Would be great if you could provide some feedback if it works for you now with basic auth.

Hi Tristan,

yep you were right, it’s because of the basic auth. I just switched to OAuth (OAI-Secure) an now it works like a charm.

As soon as your fix is available I will test it again, with basic auth.

Thank for your fast feedback.

Hi Tristan,

just to let you know, we tested the fix and it works like a charm