harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.6k stars 168 forks source link

Add authentication #95

Closed svenstaro closed 4 months ago

svenstaro commented 5 months ago

OBS supports sending a bearer token. I think it'd be nice if that were supported by xiu for some basic authentication.

harlanc commented 5 months ago

What authentication methods do you usually use?

svenstaro commented 5 months ago

I think OBS uses Bearer? To be honest, I'm not super sure which authentication they support but I think it might make sense to support the same scheme.

mpisat commented 5 months ago

Whip supports Bearer: HTTP header authorization. However, it would be nice if xiu supports both Bearer and auth based on a parameter such as whip?app=live&stream=test&key=whateverencryptedpasswordhere

harlanc commented 4 months ago

To implement the feature, some refactor work needs to be done: most of the http mod codes in RTSP and WebRTC library are duplicate, which can be extracted as a common library and then the authentication logics can be added in this library.

harlanc commented 4 months ago

Reference : https://pengrl.com/lal/#/auth for the auth algorithms.

svenstaro commented 4 months ago

Thanks!

harlanc commented 4 months ago

https://harlanc.github.io/v0.10.0/docs/authentication/introduction Doc for Authentication Algorithms.