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

Request to clearkey licensing server is made with "[object Object]" in request body #3931

Closed
5 tasks done
AyrA opened this issue Apr 26, 2022 · 5 comments
Closed
5 tasks done
Labels

Comments

@AyrA
Copy link

AyrA commented Apr 26, 2022

Environment
Steps to reproduce
  1. Load the specified mpd into the reference player at https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html
Observed behavior

The request to the licensing URL is made with [object Object] with the request body instead of the actual data.

Console output

image

Request
{
    "log": {
        "version": "1.2",
        "creator": {
            "name": "Firefox",
            "version": "99.0.1"
        },
        "browser": {
            "name": "Firefox",
            "version": "99.0.1"
        },
        "pages": [{
                "startedDateTime": "2022-04-26T12:49:26.551+02:00",
                "id": "page_2",
                "title": "Dash JavaScript Player",
                "pageTimings": {
                    "onContentLoad": -18512,
                    "onLoad": -15429
                }
            }
        ],
        "entries": [{
                "pageref": "page_2",
                "startedDateTime": "2022-04-26T12:49:51.799+02:00",
                "request": {
                    "bodySize": 15,
                    "method": "POST",
                    "url": "https://demo.bitmsg.ch/api.php",
                    "httpVersion": "HTTP/2",
                    "headers": [{
                            "name": "Host",
                            "value": "demo.bitmsg.ch"
                        }, {
                            "name": "User-Agent",
                            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0"
                        }, {
                            "name": "Accept",
                            "value": "*/*"
                        }, {
                            "name": "Accept-Language",
                            "value": "en,en-US;q=0.5"
                        }, {
                            "name": "Accept-Encoding",
                            "value": "gzip, deflate, br"
                        }, {
                            "name": "Content-Type",
                            "value": "application/json"
                        }, {
                            "name": "Content-Length",
                            "value": "15"
                        }, {
                            "name": "Origin",
                            "value": "https://reference.dashif.org"
                        }, {
                            "name": "DNT",
                            "value": "1"
                        }, {
                            "name": "Connection",
                            "value": "keep-alive"
                        }, {
                            "name": "Referer",
                            "value": "https://reference.dashif.org/"
                        }, {
                            "name": "Sec-Fetch-Dest",
                            "value": "empty"
                        }, {
                            "name": "Sec-Fetch-Mode",
                            "value": "cors"
                        }, {
                            "name": "Sec-Fetch-Site",
                            "value": "cross-site"
                        }, {
                            "name": "TE",
                            "value": "trailers"
                        }
                    ],
                    "cookies": [],
                    "queryString": [],
                    "headersSize": 457,
                    "postData": {
                        "mimeType": "application/json",
                        "params": [],
                        "text": "[object Object]"
                    }
                },
                "response": {
                    "status": 400,
                    "statusText": "Bad Request",
                    "httpVersion": "HTTP/2",
                    "headers": [{
                            "name": "access-control-allow-methods",
                            "value": "HEAD, GET, POST, OPTIONS"
                        }, {
                            "name": "access-control-allow-origin",
                            "value": "*"
                        }, {
                            "name": "access-control-allow-headers",
                            "value": "Content-Type"
                        }, {
                            "name": "allow",
                            "value": "HEAD, GET, POST, OPTIONS"
                        }, {
                            "name": "strict-transport-security",
                            "value": "max-age=15768000"
                        }, {
                            "name": "vary",
                            "value": "User-Agent"
                        }, {
                            "name": "content-type",
                            "value": "application/json"
                        }, {
                            "name": "date",
                            "value": "Tue, 26 Apr 2022 10:49:53 GMT"
                        }, {
                            "name": "server",
                            "value": "Apache"
                        }, {
                            "name": "X-Firefox-Spdy",
                            "value": "h2"
                        }
                    ],
                    "cookies": [],
                    "content": {
                        "mimeType": "application/json",
                        "size": 53,
                        "text": "{\"error\":\"POST data is the string '[object Object]'\"}"
                    },
                    "redirectURL": "",
                    "headersSize": 359,
                    "bodySize": 412
                },
                "cache": {},
                "timings": {
                    "blocked": -1,
                    "dns": 0,
                    "connect": 0,
                    "ssl": 0,
                    "send": 0,
                    "wait": 46,
                    "receive": 0
                },
                "time": 46,
                "_securityState": "secure",
                "serverIPAddress": "141.95.47.146",
                "connection": "443"
            }
        ]
    }
}
Expected behavior

Proper serialization of the JSON object

@AyrA AyrA added the Bug label Apr 26, 2022
@dsilhavy
Copy link
Collaborator

dsilhavy commented Apr 26, 2022

Try nightly this was fixed recently

@AyrA AyrA closed this as completed Apr 26, 2022
@Murmur
Copy link

Murmur commented May 4, 2022

@dsilhavy I can playback ClearKey with KID:KEY base64 values in an DRMOptions/[x]ClearKey but ClearKey laurl option field does not work in DemoPlayer UI? Also was unable to playback manifest with an embedded clearkeyLaurl xml element.

Reference Client 4.4.1 (development, commit: [2bb1cd24] nightly build

ClearKey works if I use dashjs API player.setProtectionData(org.w3.clearkey: serverURL) field in a customized player page, also an embedded clearkey:LaUrl xml element worked fine in a customized player page.

Manifest https://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv7/drm/manifest_clearkey.mpd
Manifest (embedded laurl) https://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv7/drm/manifest_clearkey_laurl.mpd
LaUrl https://refapp.hbbtv.org/videos/laurl_ck.php
LaUrl(optional) https://refapp.hbbtv.org/videos/laurl_ck.php?kid=43215678123412341234123412341236

ps: The original issue [object Object] payload was fixed in a nightly build.

@dsilhavy
Copy link
Collaborator

dsilhavy commented May 4, 2022

Thanks, I think the problem is that we tried to update the key session with an empty array of keypairs. I added a potential fix for this in #3939 . Should be available in nightly soon

@Murmur
Copy link

Murmur commented May 4, 2022

Thanks nightly v4.4.1 development 50376f58 works better but [x]ClearKey/License_server posted an empty {"kids":[],"type":"temporary"} payload. My test content works if I use LaUrl(optional) license url as I give an url parameter to identify which of the KID-KEY pair should be returned from the server.

Manifest with an embedded clearkey:laurl xml field works now in DemoUI, I must not click any of the drm options.

see my test content urls one comment up.

@dsilhavy
Copy link
Collaborator

Should be fixed in nightly with #3942

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

No branches or pull requests

3 participants