Ldap – Subversion LDAP Configuration

authenticationcollabnetldapsvn

I am configuring a subversion repository to use basic LDAP authentication. I have an entry in my http.conf file that looks like this:

<Location /company/some/location>
DAV svn
SVNPath /repository/some/location
AuthType Basic
AuthName LDAP
AuthBasicProvider ldap
Require valid-user
AuthLDAPBindDN "cn=SubversionAdmin,ou=admins,o=company.com"
AuthLDAPBindPassword "XXXXXXX"
AuthLDAPURL "ldap://company.com/ou=people,o=company.com?personid"
</Location>

This works fine for living, breathing people who need to log in. However, I also need to provide application accounts access to the repository. These accounts are in a different OU. Do I need to add a whole new <location> element, or can I add a second AuthLDAPURLto the existing entry?

Best Answer

You can use mod_authn_alias to create aliases for your providers. There was an example in this question for pretty much exactly the same use case:

<AuthnProviderAlias ldap alpha>
  AuthLDAPBindDN "CN=Subversion,OU=Service Accounts,O=Alpha"
  AuthLDAPBindPassword [[REDACTED]]
  AuthLDAPURL ldap://dc01.alpha:3268/?sAMAccountName?sub?
</AuthnProviderAlias>

<AuthnProviderAlias ldap beta>
  AuthLDAPBindDN "CN=LDAPAuth,OU=Service Accounts,O=Beta"
  AuthLDAPBindPassword [[REDACTED]]
  AuthLDAPURL ldap://ldap.beta:3268/?sAMAccountName?sub?
</AuthnProviderAlias>

# Subversion Repository
<Location /svn>
  DAV svn
  SVNPath /opt/svn/repo
  AuthName "Subversion"
  AuthType Basic
  AuthBasicProvider alpha beta
  AuthzLDAPAuthoritative off
  AuthzSVNAccessFile /opt/svn/authz
  require valid-user
</Location>