Users get redirected to login page

I’m having an issue authenticating users on the web gui since going to librenms version 1.64.1 from 1.63. If I try to authenticate using either SSO or HTTP-AUTH the user gets redirected to the login page.

I take SSL cert credentials from the headers and use this to create users using SSO attributes.
I’ve been using SSO to pass the global variable $_SERVER[‘PHP_AUTH_USER’] as the username (along with the other user attributes) and this has worked fine up until going to the latest code. If I try this using http-auth the same happens. When I switch back to mysql auth and check the users I see that they have been created successfully with SSO and http-auth, but it seems after authenticating using these methods the user gets redirected to the login page and not taken to the home page.

$ ./validate.php

Component Version
LibreNMS 1.64.1-35-gff55be7
DB Schema 2020_05_24_212054_poller_cluster_settings (166)
PHP 7.4.6
Python 3.6.8
MySQL 10.4.13-MariaDB-log
RRDTool 1.7.2
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 1.10.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

I have been looking through the commits and narrowed it down to a change in ‘app/Http/Kernel.php’ in https://github.com/librenms/librenms/pull/11397/commits/7803be271442d484068d0d93153fe0e5659a84ba

If I revert the the following change it works as before:

protected $routeMiddleware = [
    + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
    - 'auth' => \App\Http\Middleware\Authenticate::class,

You are in the right area but this is the wrong fix. The problem is the ExternalAuth middleware is not applied on the login route. I probably need to rename the route groups to auth and shuffle the current auth to a different name… We can’t set it directly because the auth Routes are declared by Route::auth()… php artisan route:list. Will show the middleware for every route.