The HTTP Authentication plugin allows you to use existing means of authenticating people to WordPress. This includes Apache’s basic HTTP authentication module, Shibboleth, and many others.
To follow updates to this plugin, visit:
For help with this version, visit:
- Login as an existing user, such as admin.
- Upload the
http-authenticationfolder to your plugins folder, usually
wp-content/plugins. (Or simply via the built-in installer.)
- Activate the plugin on the Plugins screen.
- Add one or more users to WordPress, specifying the external username for the „Username“ field. Also be sure to set the role for each user.
wp-adminusing your external authentication (using, for example,
- Try logging in as one of the users added in step 4.
Note: This version works with WordPress 3.0 and above. Use the following for older versions of WordPress:
- What authentication mechanisms can I use?
Any authentication mechanism which sets the
REDIRECT_REMOTE_USER, in the case of ScriptAlias’d PHP-as-CGI) environment variable can be used in conjunction with this plugin. Examples include Apache’s
- How should I set up external authentication?
This depends on your hosting environment and your means of authentication.
Many Apache installations allow configuration of authentication via
.htaccessfiles, while some do not. Try adding the following to your blog’s top-level
Require user dwc
(You may also want to protect your
xmlrpc.phpfile, which uses separate authentication code.)
Then, create another
.htaccessfile in your
wp-admindirectory with the following contents:
Require user dwc
In both files, be sure to set
/path/to/passwordsto the location of your password file. For more information on creating this file, see below.
- Where can I find more information on configuring Apache authentication?
See Apache’s HOWTO: Authentication, Authorization, and Access Control.
- How does this plugin authenticate users?
This plugin doesn’t actually authenticate users. It simply feeds WordPress the name of a user who has successfully authenticated through Apache.
To determine the username, this plugin uses the
REDIRECT_REMOTE_USERenvironment variable, which is set by many Apache authentication modules. If someone can find a way to spoof this value, this plugin is not guaranteed to be secure.
By default, this plugin generates a random password each time you create a user or edit an existing user’s profile. However, since this plugin requires an external authentication mechanism, this password is not requested by WordPress. Generating a random password helps protect accounts, preventing one authorized user from pretending to be another.
- If I disable this plugin, how will I login?
Because this plugin generates a random password when you create a new user or edit an existing user’s profile, you will most likely have to reset each user’s password if you disable this plugin. WordPress provides a link for requesting a new password on the login screen.
Also, you should leave the
adminuser as a fallback, i.e. create a new account to use with this plugin. As long as you don’t edit the
adminprofile, WordPress will store the password set when you installed WordPress.
In the worst case scenario, you may have to use phpMyAdmin or the MySQL command line to reset a user’s password.
- Can I configure the plugin to support standard WordPress logins?
Yes. You can authenticate some users via an external, single sign-on system and other users via the built-in username and password combination. (Note: When mixed authentication is in use, this plugin does not scramble passwords as described above.)
When you configure your external authentication system, make sure that you allow users in even if they have not authenticated externally. Using Shibboleth as an example:
This enables Shibboleth authentication in „passive“ mode.
Then, in WordPress:
- Set the plugin to allow WordPress authentication.
- Configure the login URI to match your Shibboleth system. For example, if your blog is hosted at
http://example.com/, then your login URI should be
- Configure the logout URI to match your Shibboleth system. Following the above example, your logout URI would be
After saving the options, authentication will work as follows:
- If a user is already authenticated via Shibboleth, and he or she exists in the WordPress database, this plugin will log them in automatically.
- If a user is not authenticated via Shibboleth, the plugin will present the standard WordPress login form with an additional link to login via Shibboleth.
Other authentication systems (particularly those without a login or logout URI) will need to be configured differently.
- Does this plugin support multisite (WordPress MU) setups?
Yes, you can enable this plugin across a network or on individual sites. However, options will need to be set on individual sites.
If you have suggestions on how to improve network support, please submit a comment.
- How do you handle staged deployments (dev, test, prod) with the plugin?
If you have a WordPress site with multiple environments (e.g.
example.com) you can use additional variables in the login and logout URIs:
%host%– The current value of
%base%– The base domain URL (everything before the path)
%site%– The WordPress home URI
%redirect%– The return URI provided by WordPress
You can also use
%redirect_encoded%for URL-encoded values.
For example, your login URI could be:
This would be modified for each environment as appropriate.
Contributors & Developers
“HTTP Authentication” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- Avoid some PHP notices due to saving options (William Schneider)
- Fix for redirect loop on some multisite setups (#1497)
- Add option to support additional $_SERVER variables in authentication (#1477)
- Remove use of call-time pass by reference to avoid warnings on PHP 5.3 and newer
- Fix deprecation notice in WordPress 3.3 on
- Fix deprecation notice in WordPress 3.1 and later for including wp-includes/registration.php
- Associate options page label tags with their input fields (#1514)
- Update CSS to correctly center login button on WordPress 3.3
- Update plugin URIs
- Declare support for WordPress 3.2.1
- Extend variable replacement for staged deployments
- Wrap redirect parameter on login to force us through
wp-login.phpso we can check the external authentication (thanks to Josh Larios)
- Declare support for WordPress 3.2
- Update screenshots for WordPress 3.2
- Restore (and improve) support for falling back to WordPress password authentication
- Remove migration of old options format (we’ll assume enough people have upgraded)
- Update options handling to better support WordPress MU
- Restore password generation for adding and editing users
- Bump version number to make 3.0.1 the latest version on wordpress.org
- Handle authentication cookies more gracefully
- Add support for WordPress 3.0
- Update WordPress MU support for WordPress 3.0
- Add support for WordPress MU (Elliot Kendall)
- Allow for mixed HTTP and built-in authentication by falling back to wp-login.php (Elliot Kendall)