Page 1 of 1

Login to Media Browser fails with rewrite to https

PostPosted: Fri Jan 11, 2013 8:57 am
by i-matrixx
Hi all,

I´ve successfully installed serviio and in the next step I wanted to give the MediaBrowser a try.
My users must access the MediaBrowser through apache mod_proxy which I have configured according to viewtopic.php?f=5&t=6852&p=49666#p49850. In addition I have configured apache to rewrite every http request to https.
This seems to be a problem as no one is able to sign in to the MediaBrowser.

As I can see in chrome developer tools the URL http://www.example.net/cds/login is requested when the button 'Sign in' is pressed and the Status is (canceled).
The rewrite seems to break to communication. To prove my assumption I configured apache NOT to rewrite every http request to https and everything works fine.

I wondered why only the request to /cds/login was http and found out the 'http://' used for the request is hard coded in media-browser.js.

  Code:
var folderListUrl = "http://"
      + host
      + "/cds/browse/flv_player/{folderId}/BrowseDirectChildren/containers/0/0?authToken={token}";
var folderItemsUrl = "http://"
      + host
      + "/cds/browse/flv_player/{folderId}/BrowseDirectChildren/items/{offset}/{limit}?authToken={token}";
var itemMetadataUrl = "http://"
      + host
      + "/cds/browse/flv_player/{objectId}/BrowseMetadata/all/0/1?authToken={token}";

var loginUrl = "http://" + host + "/cds/login";
var logoutUrl = "http://" + host + "/cds/logout";


Why is the http:// hard coded inside the media-browser.js? Isn´t it better and even correct to use location.protocol?

I was wondering nobody else had this issue before, but I couldn´t find any post. Hope this can be solved, as I am not willing to sacrifice https communication.

Thanks for any help!

Regards

Ingo

Re: Login to Media Browser fails with rewrite to https

PostPosted: Sat Jan 12, 2013 3:45 pm
by zip
Looks a reasonable request. please file a bitbucket ticket.

Login to Media Browser fails with rewrite to https

PostPosted: Sat Jan 12, 2013 6:33 pm
by r-win
i-matrixx wrote:I was wondering nobody else had this issue before, but I couldn´t find any post. Hope this can be solved, as I am not willing to sacrifice https communication.

Actually, I had the same issue before, but I had it fixed in my local copy of the mediabrowser jar, but then I forgot to file a report. Sorry about that!

Re: Login to Media Browser fails with rewrite to https

PostPosted: Wed Jan 16, 2013 4:32 pm
by jeffshead
r-win wrote:Actually, I had the same issue before, but I had it fixed in my local copy of the mediabrowser jar, but then I forgot to file a report. Sorry about that!


How did you fix this? Can I use something like ClikView to edit the file? What are the code edits?

Also, if this change is made, is only the login done via https or does the stream also use https?

Actually, how can this work with SSL (port 443) when the port for MediaBrowser is 23424?

Re: Login to Media Browser fails with rewrite to https

PostPosted: Thu Jan 17, 2013 7:01 am
by i-matrixx
Actually, how can this work with SSL (port 443) when the port for MediaBrowser is 23424?


Seems you have skiped a important passage in my post .
My users must access the MediaBrowser through apache mod_proxy which I have configured according to viewtopic.php?f=5&t=6852&p=49666#p49850. In addition I have configured apache to rewrite every http request to https.


This only applys if you access the MediaBrowser through apache with mod_proxy and rewrite to https.
The file to edit is located in the serviio-media-browser.jar. I think it´s best to keep your hands off this if your are not knowing how to do.
I´ve opend a ticket issue/624 and I am sure this will get fixed in the next version.