{"id":801,"date":"2012-07-23T12:43:14","date_gmt":"2012-07-23T04:43:14","guid":{"rendered":"http:\/\/rmohan.com\/?p=801"},"modified":"2012-07-23T13:15:03","modified_gmt":"2012-07-23T05:15:03","slug":"htaccess-authentication-from-file-and-ldap-or-other-sources-at-the-same-time","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=801","title":{"rendered":".htaccess &#8211; Authentication from File and LDAP or other sources at the same time"},"content":{"rendered":"<h3><a href=\"http:\/\/blog.jozjan.net\/2008\/02\/htaccess-authentication-from-file-and.html\">.htaccess &#8211; Authentication from File and LDAP or other sources at the same time<\/a><\/h3>\n<p>Sometimes you may need to authenticate a user against different credentials stores, like standard files (.htpasswd), databases, ldap, &#8230;<br \/>\nWith Apache, you can use these more authentication sources by defining them in the AuthBasicProvider property.<\/p>\n<p>The configuration bellow will authenticate a user first against a file (.htpasswd) and then against an LDAP accounts.<\/p>\n<p>AuthName &#8216;Enter your Username and Password:&#8217;<br \/>\nAuthType Basic<\/p>\n<p># Authenticate against file and then against ldap<br \/>\nAuthBasicProvider file ldap<\/p>\n<p># auth file<br \/>\nAuthUserFile \/var\/www\/.htpasswd<\/p>\n<p># LDAP auth fallback to other auth mechanisms<br \/>\nAuthzLDAPAuthoritative off<br \/>\nAuthLDAPURL ldap:\/\/10.0.0.1:6361\/ou=web,dc=top?cn?sub?(objectClass=*)<\/p>\n<p># File auth<br \/>\nRequire valid-user<br \/>\n# LDAP auth<br \/>\nRequire ldap-attribute objectClass=simpleSecurityObject<\/p>\n<p>You can use it in your Apache&#8217;s configuration and in the .htaccess as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.htaccess &#8211; Authentication from File and LDAP or other sources at the same time <\/p>\n<p>Sometimes you may need to authenticate a user against different credentials stores, like standard files (.htpasswd), databases, ldap, &#8230; With Apache, you can use these more authentication sources by defining them in the AuthBasicProvider property.<\/p>\n<p>The configuration bellow will authenticate a [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/801"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=801"}],"version-history":[{"count":3,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/801\/revisions"}],"predecessor-version":[{"id":803,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/801\/revisions\/803"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}