How to authenticate web session with Plex

I am working on a custom interface that shows specific elements from Plex Media Server such a movie posters.

 

Forum Post: http://forums.plexapp.com/index.php/topic/82978-showing-off-whats-possible-with-plex/

 

Source Code: https://bitbucket.org/ryanchristensen/d4rk.co

 

Question: Right now I authenticate only the elements that I need to on the page, which is the images. I do this by attaching "?X-Plex-Token=PLEXTOKENHERE" to the end of each image address. Obviously that's not a very good method because that exposes the Plex token to the world. My question is, how would I go about authenticating the entire page so that all image requests are already authenticated. Otherwise, I'm looking at doing something with mod_rewrite to hide the true image URLs.

 

Thanks for any help!

Instead of directly linking them, you could use curl or something like that to have the server grab the contents and display to the end user.

Also note, you can use headers instead of gets for the tokens. That combined with https, you should be good to go.

Instead of directly linking them, you could use curl or something like that to have the server grab the contents and display to the end user.

Also note, you can use headers instead of gets for the tokens. That combined with https, you should be good to go.

Thank you! I will look into both of your suggestions.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.