<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=LdapSiteConfigSettingsForActiveDirectory</id>
	<title>LdapSiteConfigSettingsForActiveDirectory - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=LdapSiteConfigSettingsForActiveDirectory"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=LdapSiteConfigSettingsForActiveDirectory&amp;action=history"/>
	<updated>2026-08-22T10:33:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=LdapSiteConfigSettingsForActiveDirectory&amp;diff=1810&amp;oldid=prev</id>
		<title>Admin: 3 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=LdapSiteConfigSettingsForActiveDirectory&amp;diff=1810&amp;oldid=prev"/>
		<updated>2016-04-06T20:14:17Z</updated>

		<summary type="html">&lt;p&gt;3 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= NOTICE =&lt;br /&gt;
&lt;br /&gt;
This is very out of date and based on old versions of RT.  For modern equivalents, see [https://metacpan.org/module/RT::Authen::ExternalAuth RT::Authen::ExternalAuth] and the [https://metacpan.org/module/RT::Extension::LDAPImport LDAPImport extension].&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
This code is part of the [http://wiki.bestpractical.com/view/LDAP LDAP integration overlay]; you&amp;#039;ll also need [[LdapUserLocalOverlay]] and, optionally, [[LdapAutocreateAuthCallback]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2007/09/28 - Edward Kovarski; It has been adjusted for a Windows 2003 Active Directory Environment&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*2007/10/31 - Mario Leal; Using this code I was unable to authenticate until I changed:&lt;br /&gt;
&lt;br /&gt;
 Set($LdapFilter, &amp;#039;(objectclass=posixAccount)&amp;#039;);&lt;br /&gt;
 To:&lt;br /&gt;
 Set($LdapFilter, &amp;#039;(objectclass=*)&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
Be sure to set the following variables for your environment,&lt;br /&gt;
&lt;br /&gt;
[[LdapServer]] [[LdapBase]] [[LdapUser]] [[LdapPass]]&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
Put these in your site configuration file, [=${RTHOME}/etc/[[RT SiteConfig|RT_SiteConfig]].pm]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### What auth methods do you like and in what order?&lt;br /&gt;
 &lt;br /&gt;
 Set($AuthMethods, [&amp;#039;LDAP&amp;#039;, &amp;#039;Internal&amp;#039;]);&lt;br /&gt;
 &lt;br /&gt;
 ### LDAP Settings&lt;br /&gt;
 #&lt;br /&gt;
 # There are two different branches of this: LdapAuth* and LdapInfo*;&lt;br /&gt;
 # additionally, most of the old Ldap* variables are honored, too.&lt;br /&gt;
 #&lt;br /&gt;
 # This means if you only have one LDAP server/config you can just set&lt;br /&gt;
 # &amp;quot;LdapServer&amp;quot;, &amp;quot;LdapUser&amp;quot;, etc. and they will be used for both&lt;br /&gt;
 # authentication and information&lt;br /&gt;
 &lt;br /&gt;
 ### Enable/Disable LDAP services&lt;br /&gt;
 Set($LdapExternalAuth, 1);&lt;br /&gt;
 Set($LdapExternalInfo, 1);&lt;br /&gt;
 &lt;br /&gt;
 ### Common Settings: affecting both auth and info services&lt;br /&gt;
 &lt;br /&gt;
 # Should we create accounts for users who aren&amp;#039;t in LDAP?&lt;br /&gt;
 Set($LdapAutoCreateNonLdapUsers, 1);&lt;br /&gt;
 &lt;br /&gt;
 # Should we assign the privileged rights to the user?&lt;br /&gt;
 Set($AutoCreate, {Privileged =&amp;amp;gt; 1});&lt;br /&gt;
 &lt;br /&gt;
 # Map RT attributes to LDAP attributes&lt;br /&gt;
 #&lt;br /&gt;
 # The mapping below is known to work in Windows 2003 w/Active Directory&lt;br /&gt;
 #&lt;br /&gt;
 ####&lt;br /&gt;
 #### NOTE&lt;br /&gt;
 ####&lt;br /&gt;
 #### You have the following options for the user id with Active Directory,&lt;br /&gt;
 ####&lt;br /&gt;
 #### &amp;#039;mail&amp;#039;&lt;br /&gt;
 #### Users email address, user@mydomain.com&lt;br /&gt;
 ####&lt;br /&gt;
 #### &amp;#039;userPrincipalName&amp;#039;&lt;br /&gt;
 #### New user logon name stored in the following format, user@ad_domain.com&lt;br /&gt;
 ####&lt;br /&gt;
 #### &amp;#039;sAMAccountName&amp;#039; (Default for this config)&lt;br /&gt;
 #### Also known as the pre-Windows 2000 Logon Name&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set( $[[LdapAttrMap]], {&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;Name&amp;#039; =&amp;amp;gt; &amp;#039;sAMAccountName&amp;#039;,&lt;br /&gt;
 &amp;#039;EmailAddress&amp;#039; =&amp;amp;gt; &amp;#039;mail&amp;#039;,&lt;br /&gt;
 &amp;#039;Organization&amp;#039; =&amp;amp;gt; &amp;#039;physicalDeliveryOfficeName&amp;#039;,&lt;br /&gt;
 &amp;#039;RealName&amp;#039; =&amp;amp;gt; &amp;#039;cn&amp;#039;,&lt;br /&gt;
 &amp;#039;ExternalContactInfoId&amp;#039; =&amp;amp;gt; &amp;#039;dn&amp;#039;,&lt;br /&gt;
 &amp;#039;ExternalAuthId&amp;#039; =&amp;amp;gt; &amp;#039;sAMAccountName&amp;#039;,&lt;br /&gt;
 &amp;#039;Gecos&amp;#039; =&amp;amp;gt; &amp;#039;sAMAccountName&amp;#039;,&lt;br /&gt;
 &amp;#039;HomePhone&amp;#039; =&amp;amp;gt; &amp;#039;homePhone&amp;#039;,&lt;br /&gt;
 &amp;#039;WorkPhone&amp;#039; =&amp;amp;gt; &amp;#039;telephoneNumber&amp;#039;,&lt;br /&gt;
 &amp;#039;MobilePhone&amp;#039; =&amp;amp;gt; &amp;#039;mobile&amp;#039;,&lt;br /&gt;
 &amp;#039;PagerPhone&amp;#039; =&amp;amp;gt; &amp;#039;pager&amp;#039;,&lt;br /&gt;
 &amp;#039;Address1&amp;#039; =&amp;amp;gt; &amp;#039;streetAddress&amp;#039;,&lt;br /&gt;
 &amp;#039;Address2&amp;#039; =&amp;amp;gt; &amp;#039;postOfficeBox&amp;#039;,&lt;br /&gt;
 &amp;#039;City&amp;#039; =&amp;amp;gt; &amp;#039;l&amp;#039;,&lt;br /&gt;
 &amp;#039;State&amp;#039; =&amp;amp;gt; &amp;#039;st&amp;#039;,&lt;br /&gt;
 &amp;#039;Zip&amp;#039; =&amp;amp;gt; &amp;#039;postalCode&amp;#039;,&lt;br /&gt;
 &amp;#039;Country&amp;#039; =&amp;amp;gt; &amp;#039;co&amp;#039;,&lt;br /&gt;
 &amp;#039;FreeformContactInfo&amp;#039; =&amp;amp;gt; &amp;#039;info&amp;#039;,&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# A list of RT attrs which can uniquely identify a user,&lt;br /&gt;
 # ordered from most to least preferred.&lt;br /&gt;
 Set($LdapRTAttrMatchList, [&amp;#039;ExternalContactInfoId&amp;#039;, &amp;#039;Name&amp;#039;,&lt;br /&gt;
                            &amp;#039;EmailAddress&amp;#039;, &amp;#039;RealName&amp;#039;,&lt;br /&gt;
                            &amp;#039;WorkPhone&amp;#039;, &amp;#039;Address2&amp;#039;]&lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 # A list of LDAP attrs to examine when canonicalizing email addresses,&lt;br /&gt;
 # ordered from most to least preferred&lt;br /&gt;
 Set($LdapEmailAttrMatchList, [&amp;#039;mail&amp;#039;, &amp;#039;mailRoutingAddress&amp;#039;,&lt;br /&gt;
                               &amp;#039;mailAlternateAddress&amp;#039;]&lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 # A list of prefixes to apply to email address matches.&lt;br /&gt;
 # Windows 2003 AD uses prefixes or smtp: or SMTP:.&lt;br /&gt;
 # If not required just leave &amp;#039;&amp;#039;&lt;br /&gt;
 Set($LdapEmailAttrMatchPrefix, [&amp;#039;&amp;#039;, &amp;#039;smtp:&amp;#039;, &amp;#039;SMTP:&amp;#039;] );&lt;br /&gt;
 &lt;br /&gt;
 # The basics; if set, these override $RT::LdapAuth* and $RT::LdapInfo*&lt;br /&gt;
 Set($LdapServer, &amp;#039;ldap.example.com&amp;#039;);&lt;br /&gt;
 Set($LdapBase, &amp;#039;ou=People,dc=example,dc=com&amp;#039;);&lt;br /&gt;
 Set($LdapFilter, &amp;#039;(objectclass=posixAccount)&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 #   Windows 2003 Active Directory does not allow anonymous LDAP binding&lt;br /&gt;
 #   thus you must pass Net::LDAP a username and password that has&lt;br /&gt;
 #   access to read the directory.&lt;br /&gt;
 #&lt;br /&gt;
 #   You may also need to specify the full distinguished name instead of&lt;br /&gt;
 #   just a username for LdapUser below.&lt;br /&gt;
 #   e.g. cn=Username,cn=Users,dc=yourdomain,dc=com&lt;br /&gt;
 #&lt;br /&gt;
 Set($LdapUser, &amp;#039;ldapuser@ad.domain.com&amp;#039;);&lt;br /&gt;
 Set($LdapPass, &amp;#039;password&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # This filter is used by RT::User::UpdateFromLdap to test whether an&lt;br /&gt;
 # LDAP user&amp;#039;s RT account should be disabled. Any user whose LDAP record&lt;br /&gt;
 # passes this filter (returns true) will be disabled at login&lt;br /&gt;
 Set($LdapDisableFilter, &amp;#039;(employmentStatus=Terminated)&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # If you set these, only members of this group can auth via LDAP&lt;br /&gt;
 #Set($LdapGroup, &amp;#039;cn=RT,ou=Group,dc=example,dc=com&amp;#039;);&lt;br /&gt;
 #Set($LdapGroupAttr, &amp;#039;uniqueMember&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # These turn on SSL for LDAP&lt;br /&gt;
 #Set($LdapTLS, 0);&lt;br /&gt;
 #Set($LdapSSLVersion, 3);&lt;br /&gt;
 &lt;br /&gt;
 ### IF YOU USE THE SAME LDAP SERVER FOR AUTH AND INFO STOP HERE ###&lt;br /&gt;
 &lt;br /&gt;
 ### Authentication settings&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # These are used only if their $RT::Ldap* analogs are not set;&lt;br /&gt;
 # if you want one of these variables to be honored, you must comment&lt;br /&gt;
 # out the corresponding $RT::Ldap* variable above&lt;br /&gt;
 &lt;br /&gt;
 #Set($LdapAuthServer, &amp;#039;ldap.example.com&amp;#039;);&lt;br /&gt;
 #Set($LdapAuthBase, &amp;#039;ou=People,dc=example,dc=com&amp;#039;);&lt;br /&gt;
 #Set($LdapAuthFilter, &amp;quot;(objectclass=posixAccount)&amp;quot;);&lt;br /&gt;
 #Set($LdapAuthUser, &amp;#039;&amp;#039;);&lt;br /&gt;
 #Set($LdapAuthPass, &amp;#039;&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # This filter is used by RT::User::UpdateFromLdap to test whether an&lt;br /&gt;
 # LDAP user&amp;#039;s RT account should be disabled. Any user whose LDAP record&lt;br /&gt;
 # passes this filter (returns true) will be disabled at login&lt;br /&gt;
 # Set($LdapAuthDisableFilter, &amp;#039;(employmentStatus=Terminated)&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # If you set these, only members of this group can auth via LDAP&lt;br /&gt;
 #Set($LdapAuthGroup, &amp;#039;cn=RT,ou=Group,dc=example,dc=com&amp;#039;);&lt;br /&gt;
 #Set($LdapAuthGroupAttr, &amp;#039;uniqueMember&amp;#039;);&lt;br /&gt;
 # These turn on SSL for LDAP&lt;br /&gt;
 #Set($LdapAuthTLS, 0);&lt;br /&gt;
 #Set($LdapAuthSSLVersion, 3);&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ### Information settings&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # These are used only if their $RT::Ldap* analogs are not set;&lt;br /&gt;
 # if you want one of these variables to be honored, you must comment&lt;br /&gt;
 # out the corresponding $RT::Ldap* variable above&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #Set($LdapInfoServer, &amp;#039;ldap.example.com&amp;#039;);&lt;br /&gt;
 #Set($LdapInfoBase, &amp;#039;ou=People,dc=example,dc=com&amp;#039;);&lt;br /&gt;
 #Set($LdapInfoFilter, &amp;quot;(objectclass=posixAccount)&amp;quot;);&lt;br /&gt;
 #Set($LdapInfoUser, &amp;#039;&amp;#039;);&lt;br /&gt;
 #Set($LdapInfoPass, &amp;#039;&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # This filter is used by RT::User::UpdateFromLdap to test whether an&lt;br /&gt;
 # LDAP user&amp;#039;s RT account should be disabled. Any user whose LDAP record&lt;br /&gt;
 # passes this filter (returns true) will be disabled at login&lt;br /&gt;
 # Set($LdapInfoDisableFilter, &amp;#039;(employmentStatus=Terminated)&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 # These turn on SSL for LDAP&lt;br /&gt;
 #Set($LdapInfoTLS, 0);&lt;br /&gt;
 #Set($LdapInfoSSLVersion, 3);&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>