Support » Plugin: HTTP Authentication » [Plugin: HTTP Authentication] No REMOTE_USER ?

  • Resolved prk-wa



    When I go to /wp-admin/ which redirects to /wp-login.php the http-authentication plugin fails with “ERROR: No user found in server variables.”

    I’ve inserted a debugging loop which prints all the env variables seen at that stage, code below:

    foreach($_SERVER as $key_name => $key_value) {
    print $key_name . " = " . $key_value . "<br>";

    This shows that the REMOTE_USER variable is missing (as is AUTH_TYPE).

    However, if I put that same code snippet in a getenv.php file in the /wp-admin/ directory and go to it in my web browser, I can see that the REMOTE_USER (and AUTH_TYPE) are correctly set.

    Any idea why, when going through wp-login.php the REMOTE_USER variable isn’t available to the http-authentication plugin?

    Does something intercept / block it?

    Parameters from getenv.php:

    REMOTE_PORT = 22925
    REMOTE_USER = prk

    Parameters from within http-authentication.php:

    REMOTE_PORT = 14338

    Any help gratefully appreciated.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Gah, of course after I post, I work it out, and it’s PEBCAK.

    Turned out I didn’t have the wp-login.php Auth protected, so whilst I was seeing the REMOTE_USER in the wp-admin/ directory, it wasn’t when calling wp-login.

    Another .htaccess file and all is well.

    Sorry all.


    hi, how did you auth protect the wp-login.php?



    A .htaccess in the base WP directory (same place the wp-login.php file is) containing a files block:

    <Files wp-login.php>
            AuthName "WordPress"
            AuthType Basic
            AuthUserFile /path/to/passwords
            require valid-user

    Make sure your apache2 conf allows .htaccess files.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: HTTP Authentication] No REMOTE_USER ?’ is closed to new replies.