Modify

Opened 10 years ago

Last modified 10 years ago

#11866 new enhancement

Nginx Support/Examples

Reported by: Varriount Owned by: Emmanuel Blot
Priority: normal Component: LdapPlugin
Severity: normal Keywords: nginx
Cc: Trac Release: 1.0

Description

It would be nice if this plugin supported Nginx, (if it doesn't already, I can't get Nginx to work with this plugin) or at least had example configurations for Nginx

Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by Jun Omae

I think that you can use an unofficial module to support authentication against LDAP servers.

LDAP Authentication module for nginx https://github.com/kvspb/nginx-auth-ldap

If you try it, would you kindly add nginx example configuration to LdapPlugin page?

comment:2 Changed 10 years ago by Varriount

Yes, I've compiled that, however I'm a bit clueless as to how I'm supposed to set up the nginx configuration. I'm trying to connect to an Active Directory server on the network. I have an ldap server defined in nginx.conf like so:

http {
    upstream local_trac {
        server 127.0.0.1:3050;
        server 127.0.0.1:3051;
    }

    ...

    ldap_server test_ldap {
        url ldap://test_ldap.com/DC=testDmn;
        binddn "TEST-DMN\\varriount";
        binddn_passwd testPassword;
        group_attribute uniquemember;
        group_attribute_is_dn on;
        require valid_user;
    }

    server {
        listen 80;
        listen [::]:80;
        
        auth_ldap_servers test_ldap;

        location / {
            proxy_pass http://local_trac;
        }
    }
}

And the ldap section in trac.ini is defined like this:

[ldap]
enable = true
basedn = DC=testDmn
host = test.ldap.com
bind_user = TEST-DMN\\varriount
bind_passwd = testPassword
user_name_attr = sAMAccountName

Despite copying the configure as best I could, I get "Unable to open LDAP cnx: Invalid credentials" whenever I try to view a page on the Trac instance while logged in to my Windows computer. (Note: trac itself is running on OpenBSD)

comment:3 in reply to:  2 Changed 10 years ago by Jun Omae

Replying to Varriount:

And the ldap section in trac.ini is defined like this:

[ldap]
enable = true
basedn = DC=testDmn
host = test.ldap.com
bind_user = TEST-DMN\\varriount
bind_passwd = testPassword
user_name_attr = sAMAccountName

Despite copying the configure as best I could, I get "Unable to open LDAP cnx: Invalid credentials" whenever I try to view a page on the Trac instance while logged in to my Windows computer. (Note: trac itself is running on OpenBSD)

It seems that bind_user, bind_password, basedn and host have a problem because the error is Invalid credentials. I guess that bind_user option should be varriount or cn=varriount,dc=testDmn by LdapPlugin#PluginConfiguration.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Emmanuel Blot.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.