bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
12.23k stars 1.53k forks source link

webrtc no id in auth #1981

Closed pikachu937 closed 1 year ago

pikachu937 commented 1 year ago

Which version are you using?

v0.23.6

Which operating system are you using?

Describe the issue

empty id when using external authentication for webrtc

Describe how to replicate the issue

  1. start the server
  2. publish with rtsp/whip/rtmp
  3. read with webrtc(enable external authentication)
  4. check on the external authentication server the id parameter for webrtc, it will be null

Example: {"ip":"192.168.0.1","user":"test","password":"test123","path":"path1","protocol":"webrtc","id":null,"action":"read","query":""} [|http]

but if i read rtsp link, param id set correctly Example: {"ip":"192.168.0.1","user":"test","password":"test123","path":"path1","protocol":"rtsp","id":"09872164-0b5b-47db-886e-816d40222a74","action":"publish","query":""} [|http]

Did you attach the server logs?

yes / no

Did you attach a network dump?

yes / no

saket424 commented 1 year ago

try to build a new mediamtx binary with this commit https://github.com/bluenviron/mediamtx/commit/2faca7374942aef79ff94bbfb3e578bf6bbb2817 included or wait for v0.23.7 to try again

pikachu937 commented 1 year ago

try to build a new mediamtx binary with this commit 2faca73 included or wait for v0.23.7 to try again

I checked yesterday with a different(more recent) commit 972cd58 which already includes the 2faca73 commit you suggested, no change.

"path":"path1","protocol":"webrtc","id":null,"action":"read","query":""

aler9 commented 1 year ago

Commit 2faca73 is unrelated from this issue, that will be solved soon.

aler9 commented 1 year ago

This is fixed by #2098. Keep in my that you will still see requests with an empty ID because browser-based WebRTC clients send two anonymous requests to the server before starting a session:

  1. GET /stream/ --> this pulls the web page and is anonymous
  2. OPTIONS /stream/whep --> this pulls the list of ICE servers and is anonymous
  3. POST /stream/whep --> this creates a session and is not anonymous
  4. PATCH /stream/whep --> this updates session candidates and is not anonymous

Regarding external authentication, my advice is to use a fixed string that expires after some time, like a JWT.

github-actions[bot] commented 9 months ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.