Webrtc integration

i have completely followed the milestone docs for webrtc integration but still getting cors issues for starting session, the token is generated successfully, i get cors error only for starting the session

webrtc javascript

this is the error :

Access to fetch at ‘http://desktop-lq36vu4/api/REST/v1/WebRTC/Session’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

It looks like setting Access-Control-Allow-Headers to “*” did not work properly for you. Have you restarted the VideoOS ApiGateway AppPool in IIS? If not, your changes to appsettings.production.json will not be applied.

To verify which CORS settings the app is using, you could change the default log level to Debug and look into API Gateway logs. In order to do that, just add the following to the appsettings.production.json:

  "Logging": {
    "LogLevel": {
      "Default": "Debug"
    }
  }

Once this is done, you should see the following CORS related entries in the API Gateway logs:

2024-03-18 11:12:05.752+01:00 [ 1] INFO - Use CORS: True

2024-03-18 11:12:05.752+01:00 [ 1] DEBUG - Using CORS

2024-03-18 11:12:05.752+01:00 [ 1] DEBUG - Setting up cores allowedOrigins:* allowedheaders:* allowedmethods:*