[PHP] PlexAuth - Authentication for your domain using Plex

Hello

i’m running directadmin and i;m the owner of the server i get this message:

Warning
: require_once(inc/nav.php): failed to open stream: No such file or directory in
/home/admin/domains/darkonline.nl/public_html/plexauth/inc/pages/main.page.php
on line
12

Fatal error
: require_once(): Failed opening required ‘inc/nav.php’ (include_path=’.:/usr/local/lib/php:/home/admin/domains/darkonline.nl/public_html/plexauth/inc:/home/admin/domains/darkonline.nl/public_html/plexauth/inc/pages’) in
/home/admin/domains/darkonline.nl/public_html/plexauth/inc/pages/main.page.php
on line
12

####################
Config :

;<?php
;echo “ERROR!”
;die(); //Kill direct connection to file.
;/*

    [PLEX_SERVER]
    token = "*********"; //Follow this guide to get your token. https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token
    plexowner = "******"; //Your Plex username. Not your email.

    [PLEXPY]
    plexpy = false; //Enable or disable PlexPy features. This is only if you are using my custom PlexPy fork.

    [SERVER]
    domain = "www.darkonline.nl"; //This is used for the cookie.
    protocol = "https"; //What protocol does your domain use? [https|http]
    session_path = "/tmp/phpauth_"; //This is your PHP session path folder with session prefix.

    [REMEMBER_ME]
    secure = true; //If the EememberMe cookie should be only allowed via SSL. Disable this if you are using HTTP for your domain.
    remember_cookie = "YTB-SID"; //Name of the cookie that will be used to remember user.
    expire_time = "604800"; //Time for the cookie to expire (Seconds). 604800 = 1 week.

    [PLEX_AUTH]
    debug = true; //Debug on or off.

    ;*/

;?>

####################

-rwxrwxrwx 1 admin admin 1039 Jun 23 10:09 config.ini.php

####################

Running debian jessie : httpd/apache

LOL never mind i forget nav_sample.php to rename nav.php sorry

If i use plexpy intergration what can i do more ? do i have information on your page or just a redirection to plexpy ?

Its actually just left over from earlier. The option in the config file about PlexPy doesn’t actually do anything now. I’ll probably remove it in my next commit.

What are the current SSO capabilities of this tool in regards to PlexPy, PlexRequests.Net and Plex (for those of us using web paths to separate services instead of subdomains, to take advantage of local storage)? I ask this because of the removal of Plexpy in the next commit. Lastly, any additional features on the road-map to users can look forward to in regards to PlexAuth? Thanks for your time.

I’m not removing anything in the next commit. Its only a config option that wasn’t being used. The only integration that currently exists is with the PlexPy fork and with bumpybooby (a helpdesk written in php).

I’ll be having a look at PlexRequests.net soon and seeing if I can integrate it.

The whole system is working quite well for me, I’ve added a few extra pages on my local version that allows users to invite new users and for new users to join. At this point I’ve really only been expanding specific features that work for my setup.

Is there anything in particular that you were hoping for?

Thanks for the info. I recently installed OSticket (a help desk written in php), I’ll google BumpyBooby. The new user sign up is streamlined on your end (creating a new plex account etc.)?

Not creating a new Plex user but bringing them into my system and setting up all their required accounts. Most things are integrated but a few SQL entries are needed etc.



That’s a nice solution offering, I didn’t have any other ideas. Everything is working for me, took me a few weeks to tie everything together but it was worth it. Hopefully in the future PLEX will support two factor.

I found OSTicket but thought it looked a little complicated for users. BumpyBooby is open source too. Integration was fairly simple :slight_smile:

How does one implement SSO with BumpyBump with your solution? I’ve added it per your recommendation.

I made a few changes to the index page of BumpyBooby. I just forked the github project, I’ll upload the changes in a little bit.

You’ll need to edit the session_name to whatever your php session name is. Default is PHPSESSID.

Here it is:

Nice, thanks for that. I added CloudFlare which can help do additional scrubbing via WAF (web application F/W with OWASP modsecurity rule set) at the cloud level and works nicely with your PlexAuth front facing login solution. Quick question, locally do you have a setup for Fail2Ban that is tied to PlexAuth responses (if login fails XX amount of times, push ban notification to pushbullet/slack etc.)? Thanks.

I haven’t got any implementation with Fail2Ban yet.

Had a bit of a look at this today, I’m running my PlexAuth through CloudFlare. Fail2Ban wouldn’t work because the IP wouldn’t be the users. If you aren’t using CloudFlare then you could just log the IP into a log file and get Fail2Ban to read the log.

Yeah, I caught that after the WAF implementation but it looks like no Fail2Ban due to the IP being shown as CloudFlare (real IP Nginx module wouldn’t be able to do much). I tried out your implementation of Bumpy (I was successful with the original), ran into some small hiccups on the fork.

Instead of getting the correct URL of:

https://domain.com**/bumpy/**index.php?project=default&page=dashboard”

I get this 404 URL:

https://domain.comindex.php**/**?project=default&page=dashboard”

The difference:

  1. “/” after the domain
  2. no “bumpy” directory
  3. adds a “/” before the question mark.

Thanks.

Hmm thats strange. I haven’t changed anything to do with the URL. When you changed forks did you keep your config?

Nope started from scratch and entered in all my data based on the comments you left in the modified code.

I’ve only really looked into BB as much as I’ve needed to to get PlexAuth working.

I’d start by dropping your existing database folder (from your working install) over the top of the new one.

When I set it up for me, I made the changes to the code after having it setup… There could be some setup stuff that i’ve broken.