Apache 2.4 how to authenticate a user against two different OUs











up vote
0
down vote

favorite












Does anyone have any idea how to authenticate a user against two different OUs on the same Active Directory server?



I am using Apache 2.4 on Ubuntu 18.04.

  Server version: Apache/2.4.18 (Ubuntu)

  Server built: 2018-06-07T19:43:03



The user could be in "ABC User" or "XYZ user".



AD OUs are:



AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



and



AuthLDAPURL "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



Part of the current conf file:



<Location />
AuthName "ABC Intranet"
AuthBasicProvider ldap

AuthType Basic
AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"

# login to AD
AuthLDAPBindDN "CN=ldap_ABCweb,OU=ABC Service Accounts,DC=ABC,DC=org"
AuthLDAPBindPassword
AuthLDAPGroupAttributeIsDN off
AuthLDAPGroupAttribute memberUid

# tried this and failed
# Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*')|(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))

# tried this and failed
# <RequireAny>
# Require ldap-filter (&(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
# Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
# </RequireAny>

# require any is implied
require any
Require valid-user
Require ip 10.46
Require ip 130.44
Require ip 10.44

</Location>


I have a userid supplied by the user via a user/password prompt supplied by Apache. In order for the user to login they need to be in either of these OUs:



"ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



or



"ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



I don’t know how to configure the auth module in Apache 2.4 to validate against more than one OU.










share|improve this question









New contributor




dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite












    Does anyone have any idea how to authenticate a user against two different OUs on the same Active Directory server?



    I am using Apache 2.4 on Ubuntu 18.04.

      Server version: Apache/2.4.18 (Ubuntu)

      Server built: 2018-06-07T19:43:03



    The user could be in "ABC User" or "XYZ user".



    AD OUs are:



    AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



    and



    AuthLDAPURL "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



    Part of the current conf file:



    <Location />
    AuthName "ABC Intranet"
    AuthBasicProvider ldap

    AuthType Basic
    AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"

    # login to AD
    AuthLDAPBindDN "CN=ldap_ABCweb,OU=ABC Service Accounts,DC=ABC,DC=org"
    AuthLDAPBindPassword
    AuthLDAPGroupAttributeIsDN off
    AuthLDAPGroupAttribute memberUid

    # tried this and failed
    # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*')|(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))

    # tried this and failed
    # <RequireAny>
    # Require ldap-filter (&(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
    # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
    # </RequireAny>

    # require any is implied
    require any
    Require valid-user
    Require ip 10.46
    Require ip 130.44
    Require ip 10.44

    </Location>


    I have a userid supplied by the user via a user/password prompt supplied by Apache. In order for the user to login they need to be in either of these OUs:



    "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



    or



    "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



    I don’t know how to configure the auth module in Apache 2.4 to validate against more than one OU.










    share|improve this question









    New contributor




    dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Does anyone have any idea how to authenticate a user against two different OUs on the same Active Directory server?



      I am using Apache 2.4 on Ubuntu 18.04.

        Server version: Apache/2.4.18 (Ubuntu)

        Server built: 2018-06-07T19:43:03



      The user could be in "ABC User" or "XYZ user".



      AD OUs are:



      AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      and



      AuthLDAPURL "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      Part of the current conf file:



      <Location />
      AuthName "ABC Intranet"
      AuthBasicProvider ldap

      AuthType Basic
      AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"

      # login to AD
      AuthLDAPBindDN "CN=ldap_ABCweb,OU=ABC Service Accounts,DC=ABC,DC=org"
      AuthLDAPBindPassword
      AuthLDAPGroupAttributeIsDN off
      AuthLDAPGroupAttribute memberUid

      # tried this and failed
      # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*')|(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))

      # tried this and failed
      # <RequireAny>
      # Require ldap-filter (&(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
      # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
      # </RequireAny>

      # require any is implied
      require any
      Require valid-user
      Require ip 10.46
      Require ip 130.44
      Require ip 10.44

      </Location>


      I have a userid supplied by the user via a user/password prompt supplied by Apache. In order for the user to login they need to be in either of these OUs:



      "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      or



      "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      I don’t know how to configure the auth module in Apache 2.4 to validate against more than one OU.










      share|improve this question









      New contributor




      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Does anyone have any idea how to authenticate a user against two different OUs on the same Active Directory server?



      I am using Apache 2.4 on Ubuntu 18.04.

        Server version: Apache/2.4.18 (Ubuntu)

        Server built: 2018-06-07T19:43:03



      The user could be in "ABC User" or "XYZ user".



      AD OUs are:



      AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      and



      AuthLDAPURL "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      Part of the current conf file:



      <Location />
      AuthName "ABC Intranet"
      AuthBasicProvider ldap

      AuthType Basic
      AuthLDAPURL "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"

      # login to AD
      AuthLDAPBindDN "CN=ldap_ABCweb,OU=ABC Service Accounts,DC=ABC,DC=org"
      AuthLDAPBindPassword
      AuthLDAPGroupAttributeIsDN off
      AuthLDAPGroupAttribute memberUid

      # tried this and failed
      # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*')|(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))

      # tried this and failed
      # <RequireAny>
      # Require ldap-filter (&(memberOf='OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
      # Require ldap-filter (&(memberOf='OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*'))
      # </RequireAny>

      # require any is implied
      require any
      Require valid-user
      Require ip 10.46
      Require ip 130.44
      Require ip 10.44

      </Location>


      I have a userid supplied by the user via a user/password prompt supplied by Apache. In order for the user to login they need to be in either of these OUs:



      "ldap://adx.ABC.org:389/OU=ABC Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      or



      "ldap://adx.ABC.org:389/OU=XYZ Users,DC=ABC,DC=org?sAMAccountName?sub?(objectClass=*)"



      I don’t know how to configure the auth module in Apache 2.4 to validate against more than one OU.







      18.04 active-directory apache2.4






      share|improve this question









      New contributor




      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Dec 13 at 21:12









      karel

      56.4k11124142




      56.4k11124142






      New contributor




      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Dec 13 at 18:01









      dnp60

      11




      11




      New contributor




      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      dnp60 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          dnp60 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100677%2fapache-2-4-how-to-authenticate-a-user-against-two-different-ous%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          dnp60 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          dnp60 is a new contributor. Be nice, and check out our Code of Conduct.













          dnp60 is a new contributor. Be nice, and check out our Code of Conduct.












          dnp60 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100677%2fapache-2-4-how-to-authenticate-a-user-against-two-different-ous%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          數位音樂下載

          When can things happen in Etherscan, such as the picture below?

          格利澤436b