SVN with LDAP authentication not working

2019-05-18 17:25发布

I'll first start with my setup. For this we have 2 servers

Server1 is going to be used for all the sourcecode, files, etc.., And on Server2 we have all our user information and logins. Both servers are running on Centos 6.4

Now we want to setup a SVN repository on server1 thats working with apache (httpd) and has a LDAP authentication that uses accounts from server 2.

Previously i set up a CVS repo aswel so i'm 100% sure ldap is working.

My SVN repo is working as it should with apache, but i just can't seem to set my ldap authentication correctly.

I've been looking for a few days now and i don't know what to do anymore.

My /etc/httpd/conf.d/subversion.conf looks like the following

<Location /svn>

    DAV svn
    SVNPath                 /var/www/svn/testProject
    AuthType                Basic
    AuthName                "My repo"
    AuthzLDAPAuthoritative  on
    AuthLDAPURL             "ldap://192.168.1.2:389/cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
    AuthUserFile            /var/www/svn-auth-conf
    Require valid-user
    #AuthzSVNAccessFile     /var/www/svn-acces-control

my /etc/openldap/ldap.conf on server1 looks like this

REFERRALS off
TLS_CACERTDIR /etc/openldap/cacerts
URI ldap://macserver.intranet.zappware.com
BASE cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com

On server1 i have root access so i am able to setup it up correctly. When i go to Server2 on my user account i can do a ldapsearch like this

userM$ ldapsearch -x -b cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com

I get all the user accounts on that server

but when i try ldapsearch -x -b cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com -W sAMAccount Server2 asks me for the LDAP password. But i don't have that password, and our previous IT manager who did all the server stuff, has left the company.

so i thought i could just make another password and put in in the

/etc/openldap/slapd.conf

but when i check that file on server 2 its just empty

Hopefully there is someone who could give me some new and helpfull tips on how to solve this

1条回答
三岁会撩人
2楼-- · 2019-05-18 18:06

Ok i solved it

Changed my LDAPURL cause there was no need for me to bind it.

    <Location /svn>

        DAV svn
        SVNPath                 /var/www/svn/testProject
        AuthBasicProvider       ldap
        AuthType                Basic
        AuthName                "My repo"
        AuthzLDAPAuthoritative  off
        AuthLDAPURL             "ldap://192.168.1.2:389/cn=users,dc=server2,dc=intranet,dc=myCompany,dc=com" NONE
        Require valid-user
</Location>

I forgot to declare the AuthBasicProvider ldap

hope this can be useful to others

查看更多
登录 后发表回答