Preface: I have seen a couple similar questions but nothing has fixed the issue for me.

I am having an issue where local logins to my osTicket admin portal are working fine, but I get stuck in a redirect loop when logging in with an account using LDAP to authenticate.

This is my setup:

  • Ubuntu 20.04 server
  • osTicket v1.15.3.1
  • PHP v7.2
  • Apache v2.4.41
  • MySQL v8.0.26
  • LDAP Authentication and Lookup plugin v0.6.2

When I sign in and get the redirect loops, nothing is logged in the Apache error logs.

Here is a screenshot of all the requests that get sent once I login:

.

login.php routes to settings.php, and vice versa in a never ending loop until I get "This page isn't working. <IP> redirected you too many times."

I have installed the PHP LDAP extension on my server, and installed the LDAP Authentication and Lookup plugin v0.6.2 in the Admin Panel -> Manage -> Plugins.

As I mentioned at the beginning of this post, local login works with the admin account created during setup. This only happens with LDAP logins.

What is possibly causing this issue?

Thanks,
Michael

Most Loops like you are describing are caused by the webserver configuration.
You probably want to look at any rewrite rules that you have in place.

@ntozier The issue was not actually a web config issue, it was in the code. When the board was switched offline, and I try to sign in as an agent, it gives me the redirect error. I was debugging and found that it happened in staff.inc.php on line 92:

//2) if not super admin..check system status and group status
if(!$thisstaff->isAdmin()) {
    //Check for disabled staff or group!
    if (!$thisstaff->isActive()) {
        staffLoginPage(__('Access Denied. Contact Admin'));
        exit;
    }

    //Staff are not allowed to login in offline mode!!
    if(!$ost->isSystemOnline() || $ost->isUpgradePending()) {
        staffLoginPage(__('System Offline'));                 // <-------------------- this line here
        exit;
    }
}

which calls this function:

    function staffLoginPage($msg) {
        global $ost, $cfg;
        $_SESSION['_staff']['auth']['dest'] =
            '/' . ltrim($_SERVER['REQUEST_URI'], '/');
        $_SESSION['_staff']['auth']['msg']=$msg;

        // Redirect here with full path for application-type plugins
        Http::redirect(ROOT_PATH.'scp/login.php');      // <---------- redirects back to login
        exit;
    }

which redirects back to scp/login, but does not clear the session, so from login.php, the program will get back to this line of code again - causing the infinite loop of redirects.

Let me know if I should create a ticket for this on github.

Write a Reply...