This gist contains a simple plugin that automatically logs in a user into Wordpress with the login name provided by HTTP basic authentication. If no HTTP authentication is present, the plugin exits the rendering process; if a user is logged in who does not have a Wordpress account, the plugin also exits.
This plugin is intended for internal blogs, for example for a team, which are anyway protected by HTTP basic authentication and where you want a single-sign-on solution.
Simply paste the PHP file into the wp-content/plugins
folder and then enable the plugin in admin panel
- http-authentication plugin on wordpress.org. That plugin is quite old and has not been updated for a while; also its code is quite complex
- codex:wp_set_current_user has an example how to log in a user, set the auth cookie etc.