OpenVidu v3 with v2compatibility: 405 error on /api/tokens endpoint in Spring Boot

I am looking to use OpenVidu version 3 with v2compatibility. I have an Angular frontend using openvidu-browser, and a Spring Boot backend.

As indicated in the documentation, I updated the libraries to openvidu-java-client-v2compatibility and openvidu-browser-v2compatibility (JS). On the server side, I cloned openvidu-local-deployment and started the Pro version Docker Compose.

My issue is on the Spring Boot side. When generating the token with:

return session.generateToken(tokenOptions);

the request is sent to:

http://localhost:4443/openvidu/api/tokens

but this endpoint returns a 405 error. It looks like this route does not exist. I don’t understand how this could work out of the box without it, as the token now seems to be provided by LiveKit.

I would like to know if I can still use v2 compatibility with OpenVidu 3, or if I should plan for a migration to v3.

Thank you for your help.

Hello @vince02444 , the /openvidu/api/tokens is deprecated since version 2.16.0.

I would consider to take a look to any of the tutorials in 2.31.0 like this one: openvidu-angular - OpenVidu Docs .

You need to use the Connection API to create a connection and then get the token from there.

All tutorials uses that approach.

Migrating to v3 is recommended though. If you want to use v3 you can check these tutorials

Hello,

Thank you very much for your reply. Sorry for the late response, I was on vacation :slight_smile:
Indeed, I hadn’t noticed that it was deprecated.
We have a time constraint to get the current system working. As it is, it works using /openvidu/api/tokens.
If I can no longer use openvidu-browser and have to switch to openvidu-angular, I think it would be better to go ahead and migrate directly to v3.