Skip to content

Cross Domain user credentials passing #4467

@iliyan85

Description

@iliyan85

Is your feature request related to a problem? Please describe.

In some cases a given HLS service, that provides m3u8 playlist and chunk files can require authentication and perform user authentication process with using of Cookies, JWT, Basic Auth or even TLS Client Certificate.

It means, that the xhr request in the hls.js player must authenticate to access the given HLS service.
If the origin domain of HLS service and hls.js player is a common, everything is fine.
But in otherwise, we have an issue!
I tested the newest versions of Hls.js player and they can not provide user credentials to other domain.

Describe the solution you'd like

In the release package the solution is very simple.

In the file dist/hls.js search for the line

var xhr = this.loader = new self.XMLHttpRequest();

image

and you could add

xhr.withCredentials = true;

bellow it.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions