Active Directory Integration
Automated login from windows credentials (10 posts)

  1. bmwinchester
    Posted 5 years ago #

    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.


  2. bmwinchester
    Posted 5 years ago #

    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.


  3. glatze
    Plugin Author

    Posted 5 years ago #

    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.

  4. 14sskillz
    Posted 5 years ago #

    i would be pleased to see this feature!

  5. AdamUK
    Posted 5 years ago #

    I second the above^

  6. xt1
    Posted 5 years ago #

    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.

  7. glatze
    Plugin Author

    Posted 5 years ago #

    I'll add this feature in a future version.

  8. robbie59
    Posted 5 years ago #

    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.


  9. glatze
    Plugin Author

    Posted 5 years ago #

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

  10. alexnolan
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Active Directory Integration
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic