{"id":1517,"date":"2005-03-10T17:32:55","date_gmt":"2005-03-10T17:32:55","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/http-authentication\/"},"modified":"2024-04-24T13:06:27","modified_gmt":"2024-04-24T13:06:27","slug":"http-authentication","status":"publish","type":"plugin","link":"https:\/\/cl.wordpress.org\/plugins\/http-authentication\/","author":12865,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"4.6","stable_tag":"4.6","tested":"6.5.8","requires":"3.1","requires_php":"","requires_plugins":null,"header_name":"HTTP Authentication","header_author":"Daniel Westermann-Clark","header_description":"","assets_banners_color":"","last_updated":"2024-04-24 13:06:27","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/danieltwc.com\/2011\/http-authentication-4-0\/","header_author_uri":"http:\/\/danieltwc.com\/","rating":5,"author_block_rating":0,"active_installs":600,"downloads":50944,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"dwc","date":"2005-05-12 14:13:02"},"1.1":{"tag":"1.1","author":"dwc","date":"2005-06-13 19:41:25"},"1.2":{"tag":"1.2","author":"dwc","date":"2005-08-24 22:35:59"},"1.3":{"tag":"1.3","author":"dwc","date":"2005-08-26 23:55:36"},"1.4":{"tag":"1.4","author":"dwc","date":"2006-01-12 18:57:56"},"1.5":{"tag":"1.5","author":"dwc","date":"2006-01-20 22:31:13"},"1.6":{"tag":"1.6","author":"dwc","date":"2007-01-01 20:21:41"},"1.7":{"tag":"1.7","author":"dwc","date":"2007-03-16 04:29:29"},"1.8":{"tag":"1.8","author":"dwc","date":"2008-04-15 21:34:58"},"1.8.1":{"tag":"1.8.1","author":"dwc","date":"2008-09-29 17:41:02"},"2.0":{"tag":"2.0","author":"dwc","date":"2008-04-16 21:54:38"},"2.1":{"tag":"2.1","author":"dwc","date":"2008-09-01 20:19:51"},"2.2":{"tag":"2.2","author":"dwc","date":"2008-09-26 18:38:47"},"2.3":{"tag":"2.3","author":"dwc","date":"2010-07-13 13:33:18"},"2.4":{"tag":"2.4","author":"dwc","date":"2010-07-13 13:33:18"},"3.0":{"tag":"3.0","author":"dwc","date":"2010-07-13 15:27:48"},"3.0.1":{"tag":"3.0.1","author":"dwc","date":"2010-07-14 03:48:44"},"3.1":{"tag":"3.1","author":"dwc","date":"2010-07-14 13:27:40"},"3.2":{"tag":"3.2","author":"dwc","date":"2010-07-15 20:32:45"},"4.0":{"tag":"4.0","author":"dwc","date":"2011-07-04 19:41:52"},"4.1":{"tag":"4.1","author":"dwc","date":"2011-07-06 21:47:37"},"4.2":{"tag":"4.2","author":"dwc","date":"2011-08-28 20:18:20"},"4.3":{"tag":"4.3","author":"dwc","date":"2011-10-02 22:26:44"},"4.4":{"tag":"4.4","author":"dwc","date":"2012-01-22 02:00:46"},"4.5":{"tag":"4.5","author":"dwc","date":"2012-06-25 00:18:49"},"4.6":{"tag":"4.6","author":"dwc","date":"2024-04-24 13:06:27"}},"upgrade_notice":{"4.5":"<p>Avoid some PHP errors and warnings; add support for choosing $_SERVER variables<\/p>","4.4":"<p>Minor CSS fix for WordPress 3.3<\/p>","4.3":"<p>No code changes; updating plugin URIs<\/p>","4.2":"<p>Extends support for variable replacement<\/p>","4.1":"<p>Minor update for WordPress 3.2<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.8.1","2.0","2.1","2.2","2.3","2.4","3.0","3.0.1","3.1","3.2","4.0","4.1","4.2","4.3","4.4","4.5","4.6"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3076472,"resolution":"1","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3076472,"resolution":"2","location":"plugin"}},"screenshots":{"1":"Plugin options, allowing WordPress authentication","2":"WordPress login form with external authentication link"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[710],"plugin_category":[38],"plugin_contributors":[82794],"plugin_business_model":[],"class_list":["post-1517","plugin","type-plugin","status-publish","hentry","plugin_tags-authentication","plugin_category-authentication","plugin_contributors-dwc","plugin_committers-dwc"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/http-authentication.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/http-authentication\/trunk\/screenshot-1.png?rev=3076472","caption":"Plugin options, allowing WordPress authentication"},{"src":"https:\/\/ps.w.org\/http-authentication\/trunk\/screenshot-2.png?rev=3076472","caption":"WordPress login form with external authentication link"}],"raw_content":"<!--section=description-->\n<p>The HTTP Authentication plugin allows you to use existing means of authenticating people to WordPress. This includes Apache's basic HTTP authentication module, <a href=\"http:\/\/shibboleth.internet2.edu\/\">Shibboleth<\/a>, and many others.<\/p>\n\n<p>To follow updates to this plugin, visit:<\/p>\n\n<p>https:\/\/danieltwc.com\/<\/p>\n\n<p>For help with this version, visit:<\/p>\n\n<p>https:\/\/danieltwc.com\/2011\/http-authentication-4-0\/<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Login as an existing user, such as admin.<\/li>\n<li>Upload the <code>http-authentication<\/code> folder to your plugins folder, usually <code>wp-content\/plugins<\/code>. (Or simply via the built-in installer.)<\/li>\n<li>Activate the plugin on the Plugins screen.<\/li>\n<li>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.<\/li>\n<li>Logout.<\/li>\n<li>Protect <code>wp-login.php<\/code> and <code>wp-admin<\/code> using your external authentication (using, for example, <code>.htaccess<\/code> files).<\/li>\n<li>Try logging in as one of the users added in step 4.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='what%20authentication%20mechanisms%20can%20i%20use%3F'><h3>What authentication mechanisms can I use?<\/h3><\/dt>\n<dd><p>Any authentication mechanism which sets the <code>REMOTE_USER<\/code> (or <code>REDIRECT_REMOTE_USER<\/code>, in the case of ScriptAlias'd PHP-as-CGI) environment variable can be used in conjunction with this plugin. Examples include Apache's <code>mod_auth<\/code> and <code>mod_auth_ldap<\/code>.<\/p><\/dd>\n<dt id='how%20should%20i%20set%20up%20external%20authentication%3F'><h3>How should I set up external authentication?<\/h3><\/dt>\n<dd><p>This depends on your hosting environment and your means of authentication.<\/p>\n\n<p>Many Apache installations allow configuration of authentication via <code>.htaccess<\/code> files, while some do not. Try adding the following to your blog's top-level <code>.htaccess<\/code> file:\n    \n    AuthName \"WordPress\"\n    AuthType Basic\n    AuthUserFile \/path\/to\/passwords\n    Require user dwc\n    <\/p>\n\n<p>(You may also want to protect your <code>xmlrpc.php<\/code> file, which uses separate authentication code.)<\/p>\n\n<p>Then, create another <code>.htaccess<\/code> file in your <code>wp-admin<\/code> directory with the following contents:\n    AuthName \"WordPress\"\n    AuthType Basic\n    AuthUserFile \/path\/to\/passwords\n    Require user dwc<\/p>\n\n<p>In both files, be sure to set <code>\/path\/to\/passwords<\/code> to the location of your password file. For more information on creating this file, see below.<\/p><\/dd>\n<dt id='where%20can%20i%20find%20more%20information%20on%20configuring%20apache%20authentication%3F'><h3>Where can I find more information on configuring Apache authentication?<\/h3><\/dt>\n<dd><p>See Apache's HOWTO: <a href=\"http:\/\/httpd.apache.org\/docs\/howto\/auth.html\">Authentication, Authorization, and Access Control<\/a>.<\/p><\/dd>\n<dt id='how%20does%20this%20plugin%20authenticate%20users%3F'><h3>How does this plugin authenticate users?<\/h3><\/dt>\n<dd><p>This plugin doesn't actually authenticate users. It simply feeds WordPress the name of a user who has successfully authenticated through Apache.<\/p>\n\n<p>To determine the username, this plugin uses the <code>REMOTE_USER<\/code> or the <code>REDIRECT_REMOTE_USER<\/code> environment 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.<\/p>\n\n<p>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.<\/p><\/dd>\n<dt id='if%20i%20disable%20this%20plugin%2C%20how%20will%20i%20login%3F'><h3>If I disable this plugin, how will I login?<\/h3><\/dt>\n<dd><p>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.<\/p>\n\n<p>Also, you should leave the <code>admin<\/code> user as a fallback, i.e. create a new account to use with this plugin. As long as you don't edit the <code>admin<\/code> profile, WordPress will store the password set when you installed WordPress.<\/p>\n\n<p>In the worst case scenario, you may have to use phpMyAdmin or the MySQL command line to <a href=\"http:\/\/codex.wordpress.org\/Resetting_Your_Password\">reset a user's password<\/a>.<\/p><\/dd>\n<dt id='can%20i%20configure%20the%20plugin%20to%20support%20standard%20wordpress%20logins%3F'><h3>Can I configure the plugin to support standard WordPress logins?<\/h3><\/dt>\n<dd><p>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.)<\/p>\n\n<p>When you configure your external authentication system, make sure that you allow users in even if they have not authenticated externally. Using <a href=\"http:\/\/shibboleth.internet2.edu\/\">Shibboleth<\/a> as an example:\n    AuthName \"Shibboleth\"\n    AuthType Shibboleth\n    Require Shibboleth<\/p>\n\n<p>This enables Shibboleth authentication in <a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/NativeSPProtectContent\">\"passive\" mode<\/a>.<\/p>\n\n<p>Then, in WordPress:<\/p>\n\n<ol>\n<li>Set the plugin to allow WordPress authentication.<\/li>\n<li>Configure the login URI to match your Shibboleth system. For example, if your blog is hosted at <code>http:\/\/example.com\/<\/code>, then your login URI should be <code>http:\/\/example.com\/Shibboleth.sso\/Login?target=%redirect_encoded%<\/code>.<\/li>\n<li>Configure the logout URI to match your Shibboleth system. Following the above example, your logout URI would be <code>http:\/\/example.com\/Shibboleth.sso\/Logout?return=%redirect_encoded%<\/code>.<\/li>\n<\/ol>\n\n<p>After saving the options, authentication will work as follows:<\/p>\n\n<ul>\n<li>If a user is already authenticated via Shibboleth, and he or she exists in the WordPress database, this plugin will log them in automatically.<\/li>\n<li>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.<\/li>\n<\/ul>\n\n<p>Other authentication systems (particularly those without a login or logout URI) will need to be configured differently.<\/p><\/dd>\n<dt id='does%20this%20plugin%20support%20multisite%20%28wordpress%20mu%29%20setups%3F'><h3>Does this plugin support multisite (WordPress MU) setups?<\/h3><\/dt>\n<dd><p>Yes, you can enable this plugin across a network or on individual sites. However, options will need to be set on individual sites.<\/p>\n\n<p>If you have suggestions on how to improve network support, please submit a comment.<\/p><\/dd>\n<dt id='how%20do%20you%20handle%20staged%20deployments%20%28dev%2C%20test%2C%20prod%29%20with%20the%20plugin%3F'><h3>How do you handle staged deployments (dev, test, prod) with the plugin?<\/h3><\/dt>\n<dd><p>If you have a WordPress site with multiple environments (e.g. <code>dev.example.com<\/code>, <code>test.example.com<\/code>, and <code>example.com<\/code>) you can use additional variables in the login and logout URIs:<\/p>\n\n<ul>\n<li><code>%host%<\/code> - The current value of <code>$_SERVER['HTTP_HOST']<\/code><\/li>\n<li><code>%base%<\/code> - The base domain URL (everything before the path)<\/li>\n<li><code>%site%<\/code> - The WordPress home URI<\/li>\n<li><code>%redirect%<\/code> - The return URI provided by WordPress<\/li>\n<\/ul>\n\n<p>You can also use <code>%host_encoded%<\/code>, <code>%site_encoded%<\/code>, and <code>%redirect_encoded%<\/code> for URL-encoded values.<\/p>\n\n<p>For example, your login URI could be:<\/p>\n\n<pre><code>https:\/\/%host%\/Shibboleth.sso\/Login?target=%redirect_encoded%\n<\/code><\/pre>\n\n<p>This would be modified for each environment as appropriate.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>4.6<\/h4>\n\n<ul>\n<li>Add PHP 7\/8 compatibility by updating constructor to use __construct<\/li>\n<\/ul>\n\n<h4>4.5<\/h4>\n\n<ul>\n<li>Avoid some PHP notices due to saving options (William Schneider)<\/li>\n<li>Fix for redirect loop on some multisite setups (#1497)<\/li>\n<li>Add option to support additional $_SERVER variables in authentication (#1477)<\/li>\n<li>Remove use of call-time pass by reference to avoid warnings on PHP 5.3 and newer<\/li>\n<li>Fix deprecation notice in WordPress 3.3 on <code>get_userdatabylogin<\/code> (#1513)<\/li>\n<li>Fix deprecation notice in WordPress 3.1 and later for including wp-includes\/registration.php<\/li>\n<li>Associate options page label tags with their input fields (#1514)<\/li>\n<\/ul>\n\n<h4>4.4<\/h4>\n\n<ul>\n<li>Update CSS to correctly center login button on WordPress 3.3<\/li>\n<\/ul>\n\n<h4>4.3<\/h4>\n\n<ul>\n<li>Update plugin URIs<\/li>\n<\/ul>\n\n<h4>4.2<\/h4>\n\n<ul>\n<li>Declare support for WordPress 3.2.1<\/li>\n<li>Extend variable replacement for staged deployments<\/li>\n<li>Wrap redirect parameter on login to force us through <code>wp-login.php<\/code> so we can check the external authentication (thanks to Josh Larios)<\/li>\n<\/ul>\n\n<h4>4.1<\/h4>\n\n<ul>\n<li>Declare support for WordPress 3.2<\/li>\n<li>Update screenshots for WordPress 3.2<\/li>\n<\/ul>\n\n<h4>4.0<\/h4>\n\n<ul>\n<li>Restore (and improve) support for falling back to WordPress password authentication<\/li>\n<li>Remove migration of old options format (we'll assume enough people have upgraded)<\/li>\n<\/ul>\n\n<h4>3.3<\/h4>\n\n<ul>\n<li>Update options handling to better support WordPress MU<\/li>\n<\/ul>\n\n<h4>3.2<\/h4>\n\n<ul>\n<li>Restore password generation for adding and editing users<\/li>\n<\/ul>\n\n<h4>3.1<\/h4>\n\n<ul>\n<li>Bump version number to make 3.0.1 the latest version on wordpress.org<\/li>\n<\/ul>\n\n<h4>3.0.1<\/h4>\n\n<ul>\n<li>Handle authentication cookies more gracefully<\/li>\n<\/ul>\n\n<h4>3.0<\/h4>\n\n<ul>\n<li>Add support for WordPress 3.0<\/li>\n<li>Update WordPress MU support for WordPress 3.0<\/li>\n<\/ul>\n\n<h4>2.4<\/h4>\n\n<ul>\n<li>Add support for WordPress MU (Elliot Kendall)<\/li>\n<li>Allow for mixed HTTP and built-in authentication by falling back to wp-login.php (Elliot Kendall)<\/li>\n<\/ul>","raw_excerpt":"Use an external authentication source in WordPress.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1517"}],"author":[{"embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dwc"}],"wp:attachment":[{"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1517"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1517"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1517"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1517"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1517"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/cl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}