threerings / openvpn-auth-ldap

Implements username/password authentication via LDAP for OpenVPN 2.x.
Other
134 stars 63 forks source link

Help! configuring "openvpn-auth-ldap" #91

Open nateriver74 opened 1 year ago

nateriver74 commented 1 year ago

Hello!, hope someone can help me.. I have installed and configured "OpenVPN" and "OpenLDAP" on Ubuntu 22.04, moreover, I also have the plugin installed: "openvpn-auth-ldap", and it is precisely with the latter that I have a problem. This is my configuration:

<LDAP>

        # LDAP server URL
        URL             ldap://x.x.x.x:389

        # Bind DN (If your LDAP server doesn't support anonymous binds)
        BindDN          cn=admin,dc=mydomain,dc=com

        # Bind Password
        Password        P@ssw0rd

        # Network timeout (in seconds)
        Timeout         15

        # Enable Start TLS
        TLSEnable       no

        # Follow LDAP Referrals (anonymously)
        FollowReferrals no
</LDAP>
<Authorization>
        # Base DN
        BaseDN          "ou=user,dc=mydomain,dc=com"

        # User Search Filter
        SearchFilter    "(uid=%u)"
        # Require Group Membership
        RequireGroup    true
        <Group>
                BaseDN         "ou=group,dc=mydomain,dc=com"
                SearchFilter   "(cn=openVPN)"
                MemberAttribute memberUid
        </Group>
</Authorization>`

The error I have is that if I want to authenticate the users that belong to a group, it shows me a credential error, but if it is to authenticate only the users, everything is correct. RequireGroup: false => all good. RequireGroup: true => all wrong.

Is the configuration correct? Any solution?

Thank you so much!