chorus2 icon indicating copy to clipboard operation
chorus2 copied to clipboard

Casting to Chromecast and basic auth/session is not working

Open trollkarlen opened this issue 8 years ago • 4 comments

Description

Briefly describe the issue. Enable web UI with username and password, and then try to cast from the web player after login. It fails.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

Enable web UI Set user and password Open homepage and login Play video and then cast it It fails Results

Expected

Same as without basic auth

Actual

Error output

VIDEOJS: Session initialized: 8a8e4f94-ff55-43a4-ac0d-110d49e2a138 source : http://192.168.0.173:8080/vfs/.....mkv type : video/mp4 cast_sender.js:88 VIDEOJS: Cast Error: {"code":"session_error","description":"LOAD_FAILED","details":{"type":"LOAD_FAILED"}}

Additional Information

Chrome It works if i turn off basic auth

It can be due to the Headers "Access-Control-Allow-Origin:*" and more from here: https://www.wowza.com/docs/how-to-stream-from-an-android-device-to-the-google-chromecast-device

Is there anyway to send the basicauth or session header with the cast_sender script to the chromecast so it can use it when talking to the webserver ?

/T

trollkarlen avatar May 04 '17 15:05 trollkarlen

I am pretty sure I know why this fails but unsure of a good way to fix it. Chromecast connects directly to the stream url and thus needs the user/pass embedded in the url passed to the chromecast eg. http://user:pass@kodi/path/to/video.mp4.

As the auth is handled by the browser, chorus doesn't store these creds, the only way I can see this working is by having this also stored in the settings so chorus could correctly build the url.

Will need some more thought, and open to ideas for better solutions.

jez500 avatar May 06 '17 21:05 jez500

I tested with a hack and hardcoded the user/pass on the url like you described, but it seems chromecast or someone in between removes it. So it wont work :(

But i guess basic auth is not very good without https(TLS) anyway.

In my case I will have an apache proxy between internet and chorus2. Its handling the TLS part but maybe i will try to disable the basic auth in the chorus2, and let apache handle that too. But i still need to send the session_id in the url, back to apache somhow.

I will try to figure this out, but it will most probably be an apache proxy settings combined with support in chorus2. So it sends the sessionId in the url back when trying to access from chromecast. http://session_id/vfs:///path/to/video.mp4 and gets revritten in the apache proxy to the right path: http://vfs:///path/to/video.mp4

Do you have a better suggestion ?

/T

trollkarlen avatar May 28 '17 19:05 trollkarlen

I am having similar issues with Chromecast, has any solution been identified?

justinthielman avatar Oct 26 '18 12:10 justinthielman

I worked on it a little but i think the issue is in the default Chromecast app(js running on the cast that cant handle basic auth) it can handle a token or cookie but then you need something that can handle it on your server.

I tried with apache and basic auth proxy but could not get it to work unfortunately. But have not had any more time 😒

/T

On Fri, Oct 26, 2018, 14:42 justinthielman [email protected] wrote:

I am having similar issues with Chromecast, has any solution been identified?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xbmc/chorus2/issues/273#issuecomment-433394369, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFkHLfcwX4mZNYW26Jbc58EP-KbGYzTks5uowMfgaJpZM4NQ1NQ .

trollkarlen avatar Oct 26 '18 14:10 trollkarlen