Http_auth - how to?

Hi folks,

I’ve got a LibreNMS installation that’s on an isolated system, so it gets updated infrequently. It was on a version from around mid-2018, and now it has been updated to a version that’s current today. It all seems to be fine, except the http_auth that we were using for authentication no longer works. No matter what I seem to try, I just can’t get it to work in the new version (it used to work fine). I’ve appended some logs to a support case here but I thought that perhaps a better idea would be to ask - how is everybody else doing this? It’s clear that there are other people doing http_auth as there are historic questions on the forum about it, though none solve my issue.

I’ve been through the documentation here and tried many different implementations of that, but I just can’t get it to work.

Is anybody else still using http_auth, and if so, how are you getting it to work?

Thank you for any suggestions.

It feels like we’ve tried every combination of possible config by now. And since this used to work in an older version, this is looking a lot like a bug was introduced.

Is there an alternative solution, other than http_auth, to the goal of “let everybody in that is able to reach the UI”?

What about authenticating against local PAM?

Hi,

I think the problem is in app/Providers/LegacyUserProvider.php.

First it will try to create a new user who already exist in retrieveByCredentials() because in
$user = User::thisAuth()->firstOrNew(['username' => $username], $new_user ); $username = NULL

And then it will failed to update the DB Table authlog in validateCredentials() because $credentials[‘username’] = NULL

I could make it works, but I don’t understand the code enough to make a good fix… I will ask for hep :slight_smile:

Did you confirm the webserver is setting the variables?

No :confused: I think I missed the first part : LibreNMS will expect the user to have authenticated via your webservice already … my bad.

I setup a sinple .htpasswd and after entering the login/pass, I could be identified as guest.

Thanks

@ChipwizBen can you give more information about your setup ?