View Issue Details

IDProjectCategoryView StatusLast Update
1751RackTablesdefaultpublic2019-12-09 11:28
Reporterallywilson Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version0.20.11 
Summary1751: Multiple LDAP domains
DescriptionIt would be nice if we could have multiple LDAP domains.

We have multiple AD child domains in our org. We can bind to 1 LDAP domain (call it DOMAIN1.forest.com), but not to a secondary domain (call it DOMAIN2.forest.com), so we could then allow members of DOMAIN2 to be able to login.

TagsNo tags attached.
Attached Files

Activities

Lucky

Lucky

2018-10-12 17:42

reporter   ~0003825

#secret.php

$LDAP_options = array
(
  'domains' => array
  (
    array
    (
    'server' => 'dc1.domain1.local by01-dc10.domain1.local',
    'domain' => 'domain1.local',
    'search_attr' => 'userPrincipalName',
    'search_dn' => 'DC=domain1,DC=local',
    'search_bind_rdn' => 'uid=user,dc=domain1,dc=local',
    'search_bind_password' => '*password*',
    'displayname_attrs' => 'cn',
    'group_attr' => 'memberof',
    'group_filter' => '/^[Cc][Nn]=([^,]+)/',
    'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3, LDAP_OPT_REFERRALS => 0),
    'use_tls' => 0,
    ),
    array
    (
    'server' => 'dc2.domain2.local',
    'domain' => 'domain2.local',
    'search_attr' => 'userPrincipalName',
    'search_dn' => 'DC=domain2,DC=local',
    'search_bind_rdn' => 'uid=user,dc=domain2,dc=local',
    'search_bind_password' => '*password*',
    'displayname_attrs' => 'cn',
    'group_attr' => 'memberof',
    'group_filter' => '/^[Cc][Nn]=([^,]+)/',
    'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3, LDAP_OPT_REFERRALS => 0),
    'use_tls' => 0,
    )
  )
);
auth.php (25,935 bytes)   
syunwei

syunwei

2019-07-19 11:43

reporter   ~0003983

I tried you method. It not works on my racktables, version 0.21.3.
It pop-up login windows, no domain account can access.
Anything I need change?
Lucky

Lucky

2019-07-30 19:00

reporter   ~0003985

i have 0.21.11 and auth.php was modified for this version... later i try to create it as patch
syunwei

syunwei

2019-09-18 05:45

reporter   ~0003987

OK, I want confirm the method for enable multiple domains authentication.

1. put auth.php to plugin folder.
2. modify security.php with you provided code.
Lucky

Lucky

2019-11-26 17:39

reporter   ~0004013

Add permissions at configuration page by manual.
Lucky

Lucky

2019-12-06 12:52

reporter   ~0004027

Create patch for 0.21.3
1. Support multiple ldap domains. Description upper.
2. Support httpd auth + ldap auth.
For this 2nd you need configure apache (kerberose + ad manual: https://imatviyenko.github.io/blog/2018/09/11/Apache-AD-kerberos) + ldap.
Next you need change at config.php:
$user_auth_src = 'httpd+ldap';

____________________________
my apache2 location part of config:
    <Location />
        <If "%{QUERY_STRING} =~ /^login/">
            <Limit GET>
                AuthType Kerberos
                AuthName "Active Directory"
                KrbAuthRealms DOMAIN.LOCAL
                KrbServiceName HTTP
                Krb5Keytab /etc/apache2/kerb-full.keytab
                KrbMethodNegotiate On
                KrbMethodK5Passwd Off
                Require valid-user

                ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/?login=basic"><body>Kerberos authentication did not pass. Go Next</body></html>'
            </Limit>
        </If>
        <If "%{QUERY_STRING} =~ /^login=basic/">
            Require all granted
        </If>

        Require valid-user
        Require all granted

        ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/login=on"><body>Need authentication.</body></html>'
    </Location>
auth.ldap.patch (17,898 bytes)   
Lucky

Lucky

2019-12-09 08:51

reporter   ~0004029

Create patch for 0.21.3
1. Support multiple ldap domains. Description upper.
2. Support httpd auth + ldap auth.
For this 2nd you need configure apache (kerberose + ad manual: https://imatviyenko.github.io/blog/2018/09/11/Apache-AD-kerberos) + ldap.
Next you need change at config.php:
$user_auth_src = 'httpd+ldap';

____________________________
my apache2 location part of config:
    <Location />
        <If "%{QUERY_STRING} =~ /^login/">
            <Limit GET>
                AuthType Kerberos
                AuthName "Active Directory"
                KrbAuthRealms DOMAIN.LOCAL
                KrbServiceName HTTP
                Krb5Keytab /etc/apache2/kerb-full.keytab
                KrbMethodNegotiate On
                KrbMethodK5Passwd Off
                Require valid-user

                ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/?login=basic"><body>Kerberos authentication did not pass. Go Next</body></html>'
            </Limit>
        </If>
        <If "%{QUERY_STRING} =~ /^login=basic/">
            Require all granted
        </If>

        Require valid-user
        Require all granted

        ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/login=on"><body>Need authentication.</body></html>'
    </Location>

P.S.
2nd not work. sorry.
Lucky

Lucky

2019-12-09 11:28

reporter   ~0004031

Working apache config. I send to kerberos for local network and to ldap for others
    <Location />
        Order allow,deny
        Allow from all
        <If "-R '192.168.1.0/24'">
            <Limit GET>
                AuthType Kerberos
                AuthName "Active Directory"
                KrbAuthRealms DOMAIN.LOCAL
                KrbServiceName HTTP
                Krb5Keytab /etc/apache2/kerb-full.keytab
                KrbMethodNegotiate On
                KrbMethodK5Passwd Off
                Require valid-user

                ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/?login"><body>Kerberos authentication did not pass. Go Next</body></html>'
            </Limit>
        </If>
        </Else>
            Satisfy Any
        </Else>
        <If "%{QUERY_STRING} =~ /^login=basic/">
            Require all granted
        </If>

        Require valid-user

        ErrorDocument 401 '<html><meta http-equiv="refresh" content="0; URL=/login=on"><body>Need authentication.</body></html>'
    </Location>

Issue History

Date Modified Username Field Change
2017-03-23 18:45 allywilson New Issue
2018-10-12 17:42 Lucky File Added: auth.php
2018-10-12 17:42 Lucky Note Added: 0003825
2019-07-19 11:43 syunwei Note Added: 0003983
2019-07-30 19:00 Lucky Note Added: 0003985
2019-09-18 05:45 syunwei Note Added: 0003987
2019-11-26 17:39 Lucky Note Added: 0004013
2019-12-06 12:52 Lucky File Added: auth.ldap.patch
2019-12-06 12:52 Lucky Note Added: 0004027
2019-12-09 08:51 Lucky Note Added: 0004029
2019-12-09 11:28 Lucky Note Added: 0004031