Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protecting streams with authentication #484

Open
jktz903 opened this issue Aug 3, 2024 · 1 comment
Open

Protecting streams with authentication #484

jktz903 opened this issue Aug 3, 2024 · 1 comment

Comments

@jktz903
Copy link

jktz903 commented Aug 3, 2024

How do I protect my streams with basic authentication? config.json seems to offer some options but I'm unable to find any documentation on this matter. Any ideas would be appreciated.

@irtaza9
Copy link

irtaza9 commented Sep 4, 2024

You have to place your own api inside the token which will authenticate the resource. Here is a simple config having auth.

{
  "channel_defaults": {
    "on_demand": true
  },
  "server": {
    "debug": true,
    "http_debug": false,
    "http_demo": true,
    "http_dir": "",
    "http_login": "demo",
    "http_password": "demo",
    "http_port": ":8083",
    "https": false,
    "https_auto_tls": false,
    "https_auto_tls_name": "",
    "https_cert": "",
    "https_key": "",
    "https_port": "",
    "ice_credential": "",
    "ice_servers": [
      "stun:stun.l.google.com:19302"
    ],
    "token": {
    "enable": true,
    "backend": "your_api_goes_here"
    },
    "ice_username": "",
    "log_level": "info",
    "rtsp_port": "",
    "webrtc_port_max": 0,
    "webrtc_port_min": 0
  },
  "streams": {
    "random_generated": {
      "channels": {
        "0": {
          "debug": true,
          "on_demand": true,
          "url": "url?token=secret"
        }
      },
      "name": "streamname"
    }
  }
}

Now when you add new stream you have to add the query param like this with your stream rtsp://127.0.0.1:5541/demo/0?token=you_key

Note: Your endpoint which you use in the token object (your_api_goes_here) should have to return the json having key status and its value would be 0 or 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants