Support » Plugin: Active Directory Integration » [Plugin: Active Directory Integration] Automated login from windows credentials

  • bmwinchester


    I have installed your plugin Active directory integration. Is there a way to have wordpress automatically log in based on the windows login credentials using your plugin? I understand that I can login to wordpress manually based on my active directory users with your plugin but I would like to go one step further and have the wordpress login automated based on the windows login.

    Is this possible?

    thanks in advance.

Viewing 9 replies - 1 through 9 (of 9 total)
  • bmwinchester


    I have seen this question asked a couple times by other users but there has not been an answer, that I can find. Is this because it is to simple of a question or just impossible to do? Any lead from any user would be appreciated.


    Plugin Author glatze


    This is possible, but very difficult. The web server has to run on Windows. With IIS it will be possible, with Apache you’ll need mod_auth_sspi. But I haven’t done anything in this direction so far. Perhaps (!) I will implement it in a future version.

    i would be pleased to see this feature!

    I second the above^

    Take a look at this plugin:

    IIS Auth plugin for WordPress

    In a nutshell, the plugin allows WordPress to recognize IIS authentication methods, allowing the user to log in with an IIS authentication method such as Windows Authentication, Basic Authentication, or the ASP.NET forms authentication.

    The WordPress blog engine would then recognize the IIS user and use it for things like writing posts, leaving comments, or performing blog administration.

    This is nice because it allows you to integrate the app with the rest of your website which may be using a particular IIS or ASP.NET authentication mechanism, so that users log into wordpress the same exact way they log into the rest of your application.

    Plugin Author glatze


    I’ll add this feature in a future version.

    Automatic login is on my wish list also. Please point me in the right direction if this is possible.

    My goal is to have my intranet users automaticall be logged in to the wordpress site based on their windows login/ad logins. Once they log in to windows/intranet, they will come to the wordpress site and see that thay are already logged in.


    Plugin Author glatze


    As mentioned before, this is planned for a future version. But first Multisite Support has to be made.

    A quick fix for many people might be something like adding the following to your theme’s functions.php:

    function auto_login() {
    	if (!is_user_logged_in() && isset($_SERVER['LOGON_USER'])) {
    		$user_login = substr($_SERVER['LOGON_USER'], strrpos($_SERVER['LOGON_USER'],'\\')+1, strlen($_SERVER['LOGON_USER'])-strrpos($_SERVER['LOGON_USER'],'\\'));
    		$user = get_userdatabylogin($user_login);
    		$user_id = $user->ID;
    		wp_set_current_user($user_id, $user_login);
    		do_action('wp_login', $user_login);
    add_action('init', 'auto_login');

    Tested with IIS 6, Windows Authentication, no proxy (if you’re doing auto-login, you’ll probably be excluding the site from any proxying anyway).

    Works seamlessly with IE passed credentials, prompts for other browsers, and doesn’t appear to clash with ADI at all, which is nice!

    If you have any probs, try fiddling with the $user_login substring.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Active Directory Integration] Automated login from windows credentials’ is closed to new replies.