WordPress.org

Ready to get started?Download WordPress

Forums

HTTP Authentication
[resolved] No REMOTE_USER ? (4 posts)

  1. prk-wa
    Member
    Posted 2 years ago #

    Hi,

    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
    AUTH_TYPE = PUBCOOKii
    GATEWAY_INTERFACE = CGI/1.1

    Parameters from within http-authentication.php:

    REMOTE_PORT = 14338
    GATEWAY_INTERFACE = CGI/1.1

    Any help gratefully appreciated.

    prk.

    http://wordpress.org/extend/plugins/http-authentication/

  2. prk-wa
    Member
    Posted 2 years ago #

    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.

    prk.

  3. Pirco the One and Only
    Member
    Posted 1 year ago #

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

  4. prk-wa
    Member
    Posted 1 year ago #

    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
    </Files>

    Make sure your apache2 conf allows .htaccess files.

    prk.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic