Forum

Playback session authorization for SLDP Live streaming

Сергей 2022-11-05 07:48:05 UTC in Nimble Streamer

Hi all!
Playback session authorization Nimble not block for SLDP Live streaming.
For SLDP Live requests auth handler send {"return_code":403}.
For HLS requests forbidden correct.
Can fix it ?
Nimble Streamer restarted after changed.
Nimble:3.7.11-4. Debian 8.

Сергей 2022-11-05 08:29:52 UTC 

Addition for post above.
HLS request start working too after send many requests retry!

Used SSL certificates.

Aleksandr 2022-11-05 12:38:16 UTC 

- Make sure the 'Allow by default' tick is not enabled;
- Check the handler's behavior to make sure it's not returning {"return_code":200} for the tested stream for some reason;
- You can enable "Debug log" in Nimble to gather more details live.
If you still have issues - I'd suggest opening a ticket here:
https://wmspanel.com/help and sharing more details there to avoid disclosing any sensitive information of yours.

Сергей 2022-11-05 14:44:57 UTC 

- 'Allow by default' - tryed both case: with true and false
rules.conf
"AuthHandlerSettings": {
"hash": "1667584986424",
"auth_handler_url": "http:\/\/10.4.4.50:8082\/nimble_auth\/",
"auth_handler_concurrency": 10,
"allow_by_default": false
},

- Handler very simple and return constant.
We can see in logs - Forbidden 403 Nimble return, but with some retries not block.

- With debug log for HLS
access.log https://disk.yandex.ru/d/vfKYA_MI32YuBA
nimble.log https://disk.yandex.ru/d/xSvAJYK4sgkrGA
sessions.log https://disk.yandex.ru/d/p6Dl2TtgMtFpiw

- ScreenShot for HLS requests https://disk.yandex.ru/i/Mg8QlAUaTzxhCw

---------------------------------
SLDP is more interesting!
In access.log, you can see the 403 return status, but the usual data sent to the HTML player via websocket.
10.2.30.170 - - [2022-11-05 17:34:52] "GET /live/81 HTTP/1.1" 403 563 256 288750 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"

Aleksandr 2022-11-05 17:11:40 UTC 

First - the responses from handler look strange, e.g.:
13
{"
Or:
13
{"retur
etc.
Have you used this code as example?
https://github.com/Softvelum/playback-authorization/blob/master/playback_authorization_handler.py

Сергей 2022-11-06 03:30:27 UTC 

Aleksandr, thank you for answer!
Nimble very sensitive to handle answer.
I use java spring boot, not python.

1. Block work.
---------------------------------------------------
@PostMapping({ "/nimble_auth" })
public ResponseEntity<String> nimble_auth(@RequestBody String requestBody) {
return ResponseEntity.ok("{\"return_code\":200}");
}
---------------------------------------------------
HTTP/1.1 200
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 19
Date: Sat, 05 Nov 2022 18:15:48 GMT

{"return_code":403}
---------------------------------------------------

2. Block NOT work.
---------------------------------------------------
@PostMapping({ "/nimble_auth" })
public ResponseEntity<?> nimble_auth(@RequestBody String requestBody) {
JSONObject jres = null;
JSONParser parser = new JSONParser();
try {
jres = (JSONObject) parser.parse("{\"return_code\":403}");
} catch (Exception e) {
LOGGER.error("Internal error {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage());
}
return ResponseEntity.ok(jres);
}
---------------------------------------------------
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sat, 05 Nov 2022 18:24:23 GMT

{"return_code":403}
---------------------------------------------------

I will be more careful, thank you!

Post a reply


Post a new question

Categories:

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the Privacy Policy. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the Privacy Policy.
By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to the use of cookies.