{"id":128,"date":"2006-05-09T16:09:32","date_gmt":"2006-05-09T21:09:32","guid":{"rendered":"http:\/\/bitpost.com\/news\/2006\/05\/09\/http-basic-authentication-rocks-and-sucks\/"},"modified":"2006-05-10T13:01:47","modified_gmt":"2006-05-10T18:01:47","slug":"http-basic-authentication-rocks-and-sucks","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2006\/http-basic-authentication-rocks-and-sucks\/","title":{"rendered":"HTTP Basic Authentication rocks and sucks"},"content":{"rendered":"<p>I recently used Apache 2.0&#8217;s HTTP Basic Authentication (via mod_auth_dbm) to restrict access to portions of my website.  It&#8217;s simple as pie.<!--more--><\/p>\n<p>Use this block of directives in the directory you want to restrict:<\/p>\n<blockquote>\n<div class=\"code\">AuthType Basic<br \/>\nAuthName &#8220;secret area&#8221;<br \/>\nAuthDBMUserFile \/home\/me\/secret_users<br \/>\nAuthDBMGroupFile \/home\/me\/secret_users<br \/>\nAuthDBMAuthoritative on<br \/>\nRequire valid-user<\/div>\n<\/blockquote>\n<p>Then set up a cute little users database with the &#8220;htdbm&#8221; tool:<\/p>\n<blockquote>\n<div class=\"code\">cd \/home\/me<\/div>\n<div class=\"code\">htdbm -c secret_users me<br \/>\n(enter password)<br \/>\nhtdbm secret_users another_user<br \/>\n(enter password)<\/div>\n<\/blockquote>\n<p>The main problem: you really can&#8217;t &#8220;logout&#8221; once you use HTTP Basic Authentication to get access to a restricted website.  <a href=\"http:\/\/marc2.theaimsgroup.com\/?l=apache-modperl&#038;m=111945342415327\">This thread<\/a> explains why (along with some tomfoolery to hack around it).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently used Apache 2.0&#8217;s HTTP Basic Authentication (via mod_auth_dbm) to restrict access to portions of my website. It&#8217;s simple as pie.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[5,4,10,9],"tags":[],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-linux-projects","category-projects","category-tricks-tips-tools","category-websites"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-24","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":0,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}