Small change to web basic auth

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
ripienaar
Posts: 7
Joined: Fri Oct 24, 2003 7:59 am

Small change to web basic auth

Post by ripienaar »

Hello,

I want to manage my authentication using a single singon system, unfortunately from Apache this means AuthType cannot be Basic.

PHP unfortunately only sets $_SERVER[PHP_AUTH_USER] if AuthType = Basic, which is often not the case for custom auth types. This is unfortunately a stupid assumption by PHP developers that only type Basic would have usernames!

The simple work around for this is to check for $_SERVER[PHP_AUTH_USER] and for $_SERVER[REMOTE_USER] in the auth module:

Currently auth_login.php:

Code: Select all

if (isset($_SERVER["PHP_AUTH_USER"])) {
        $username = str_replace("\\", "\\\\", $_SERVER["PHP_AUTH_USER"]);
}
If this code can also check if $_SERVER[REMOTE_USER] is present and use that in the event that PHP_AUTH_USER isnt there that will help people with some other auth methods
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Noted...

Please submit a bug per http://www.cacti.net/bugs.php
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
ripienaar
Posts: 7
Joined: Fri Oct 24, 2003 7:59 am

Post by ripienaar »

rony wrote:Noted...

Please submit a bug per http://www.cacti.net/bugs.php
Done, bug number 1211
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest