[PHP] PlexAuth - Authentication for your domain using Plex

Sorry if this is a stupid question, but if I use this with Plex Requests, for example. Would the user have to first log in using this and then log in via Plex Requests, or is there a way for plexauth to send the user straight to their plex request “account”?

At this stage the user would need to login twice.

If you are using the Meteor version the authentication is only done using the browsers local storage, so you could write some JavaScript to pre-auth the user. Or just turn the authentication off for all users other than admin.

I haven’t done too much looking into pre-authing for PlexRequests.Net… but it might be possible down the track.

Hi hjone72, first of all great piece of software you got here! I have it installed and got it working on my Debian machine. Still need to figure out some glitches but for the majority of my apps auth is working. Still i have a few questions, for example you state the following:

“The idea was to secure my domain using familiar username and passwords for my users. I wanted to remove the need for users to have to sign in at each different website (comics, plex, requests, etc) but still wanted them to all be secure. I hate the idea of shared passwords so I came up with this project.”

In regards to Plex and PlexRequests, a user still needs to authenticate twice for Plex and PlexRequests to recognize that specific application user? As i read this behaviour is as designed, correct? In your case you are providing Plex and PlexRequests to users without any application specific usernames linked to these two applications, correct? So if i understand this correctly, PlexAuth provides (SSO) authentication where some individual (great) apps (like Autosub, NzbGET, Transmission, HTPCmanager, SickRage and CouchPotato etc) support individual generic authentication (one master account/password) but they do not provide SSO like behaviour as PlexAuth does, correct?!

Secondly i do not understand the function of admin_auth, if i enter this after my domain URL i get a blank white page. What is to be expected from admin_auth functionality?

Keep up the good work, i am using your application currently ans i am liking it very much!

Also at initial login PlexAuth pops up with the following URL: https://mydomain.whatever/plexauth/?return=mydomain.whatever/htpc. When PlexAuth successfully authenticates the inserted credentials i get redirected to my default PlexAuth webpage. How do i configure that i get redirected to /htpc? I am searching for that quite a while now and i am unable to find a solution :-S

Hi hjone72, first of all great piece of software you got here! I have it installed and got it working on my Debian machine. Still need to figure out some glitches but for the majority of my apps auth is working.

Thank you! :slight_smile: Glad to hear its up and running.

Still i have a few questions, for example you state the following:

“The idea was to secure my domain using familiar username and passwords for my users. I wanted to remove the need for users to have to sign in at each different website (comics, plex, requests, etc) but still wanted them to all be secure. I hate the idea of shared passwords so I came up with this project.”

I have ‘mostly’ achieved this. Unfortunately, Plex will likely always require an additional login, but it is still using those same credentials! SSO is nice, but more important is using the same credentials for all services (in my opinion).

In regards to Plex and PlexRequests, a user still needs to authenticate twice for Plex and PlexRequests to recognize that specific application user?

There isn’t really a way for us to auto login to Plex, but if you check the “remember me” on Plex it won’t require login for a long while.

PlexRequests on the other hand… Very possible! It has been on my to do list for a while now…

As i read this behaviour is as designed, correct?

Just unavoidable…

In your case you are providing Plex and PlexRequests to users without any application specific usernames linked to these two applications, correct?

Sorry, I don’t understand what you’re asking.

So if i understand this correctly, PlexAuth provides (SSO) authentication where some individual (great) apps (like Autosub, NzbGET, Transmission, HTPCmanager, SickRage and CouchPotato etc) support individual generic authentication (one master account/password) but they do not provide SSO like behaviour as PlexAuth does, correct?!

PlexAuth provides the ability to secure all of your services (NZBGet, SickRage, CP, etc) by only using Plex credentials. Rather than having a shared master password (like you’d have to with SickRage or CouchPotato) or having multiple usernames and passwords. Like you’d need to have with a setup including HTPC + some forum website + Plex.

Secondly i do not understand the function of admin_auth, if i enter this after my domain URL i get a blank white page. What is to be expected from admin_auth functionality?

admin_auth is simply there to allow further restrictions on your users. Use case examples;

  • Plex, HTPC, and your forum should be accessible by all users. (no admin_auth)
  • SickRage should be accessible by Bobby, James, and yourself. (use admin_auth to restrict these services).

In Nginx when you add the auth_request to a service, if the admin_auth is added instead of just auth, PlexAuth will look at that users “Photo Filters” and decide if the user is authenticated for this service or not. This greatly increases your control over your services! Each user who you share your Plex with can be granted or denied access to any service.

@J@cco said:
Also at initial login PlexAuth pops up with the following URL: https://mydomain.whatever/plexauth/?return=mydomain.whatever/htpc. When PlexAuth successfully authenticates the inserted credentials i get redirected to my default PlexAuth webpage. How do i configure that i get redirected to /htpc? I am searching for that quite a while now and i am unable to find a solution :-S

Hmmm this sounds like a bug. I’ll have a look and see if I can find any errors. :slight_smile:

@hjone72, Thanks for your reply, it is all very clear now. With regards to that possible bug, i’ll followup on any progress and will return with the outcome!

Pushed a pretty big update today and finally merged the Plex themed version with the master.

Cool project dude! Cant wait to try this out

@Kaninm Let me know how you go :slight_smile:

@hjone72 said:
@Kaninm Let me know how you go :slight_smile:

Alright, so I got everything setup according to your guide and I can get to the login screen. When I enter in my plex credentials it looks like they are accepted, but it just redirects me back to the same login page. This is my first foray into Linux so I may have missed something? Any ideas? (Using newest Debian)

@Kaninm
Alright, so I got everything setup according to your guide and I can get to the login screen. When I enter in my plex credentials it looks like they are accepted, but it just redirects me back to the same login page. This is my first foray into Linux so I may have missed something? Any ideas? (Using newest Debian)

Couple of questions:

  1. How has your domain been setup? secure.domain.com & otherservice.domain.com or domain.com/plexauth
  2. Do the nginx logs for PlexAuth show anything useful?

PM me if you like :slight_smile:

My domain is setup as domain.com/plexauth
I’ve found if I use IE on my physical desktop, it works fine and logs in. Chrome from my desktop and IE/chrome from work just seem to reload login page when credentials are entered. Nothing I can see in the logs

Hmm this is quite strange. I use Chrome almost exclusively so it definitely works there. It is very odd that it isn’t working from some locations.

Does ticking/unticking Remember Me have any effect? Does chrome dev tools show you any extra info?

Thanks,

I figured it out. I had the RememberMe option in config set to true and wasnt using SSL. Setting to false makes it work in Google Chrome and firefox just fine. This is pretty cool dude. You taking any donations? Gotta let people buy you a beer or something.

@Kaninm said:
I figured it out. I had the RememberMe option in config set to true and wasnt using SSL. Setting to false makes it work in Google Chrome and firefox just fine. This is pretty cool dude. You taking any donations? Gotta let people buy you a beer or something.

Awesome! Glad to hear its working :slight_smile:
I just added a donate button to the GitHub. I hadn’t even really considered donations. Thanks! :smiley:

Post some pics once you’ve got yours all setup and configured. I’m sure people would love to see it :slight_smile:

Any advice on getting menu items to display in current windows when clicked instead of opening a new window?

Under PlexAuth/inc/modules/dynamic_menu.module.php ensure that the last value is true in the menu_item array.

 "Features" => array (
    "Plex" => array("https://plex.domain.com", false), //This will appear in new window.
    "Plex Statistics" => array("https://cloud.domain.com/plexpy/home", true), //This will be iframed.
    "AudioBooks" => array("https://booksonic.domain.com", true), //This will be iframed.
    "Requests" => array("https://requests.domain.com", true), //This will be iframed.
    "Comics" => array("https://comics.domain.com", true) //This will be iframed.
)

Let me know if that works.

Thanks,

@hjone72 said:
Under PlexAuth/inc/modules/dynamic_menu.module.php ensure that the last value is true in the menu_item array.

 "Features" => array (
    "Plex" => array("https://plex.domain.com", false), //This will appear in new window.
    "Plex Statistics" => array("https://cloud.domain.com/plexpy/home", true), //This will be iframed.
    "AudioBooks" => array("https://booksonic.domain.com", true), //This will be iframed.
    "Requests" => array("https://requests.domain.com", true), //This will be iframed.
    "Comics" => array("https://comics.domain.com", true) //This will be iframed.
)

Let me know if that works.

Thanks,

Thanks for the quick reply. I saw those options in that module but they are setup the way you posted yet they still open in a new windows (I have them set to http://site.domain.com if that matters).

@Kaninm said:

Thanks for the quick reply. I saw those options in that module but they are setup the way you posted yet they still open in a new windows (I have them set to http://site.domain.com if that matters).

Hmmm. Could you confirm that the following JavaScript file is accessible? http://plexauth.domain.com/js/muximux.js