Gogs and windows active directory integration


#1

Hi,

I’m trying to get GOGS to work with windows active directory.
I’ve searched this forum and the internet for a solution here:
https://gogs.io/docs/features/authentication


I have seen people managed to get this to work. Followed many suggestions but none seem to work.
Locally created users in Gogs work fine.
When I try to login with a domain user I get the following error:
“Username or password is not correct.”
I tried username, username@domain, domain\username, username@domain.com.

I have Gogs version 0.11.43_windows_amd64, running on Windows 7, MySql 5.7.21.0.
Setup Authentication setting along with Bind DN.
Tried to creating a user with authentication source as the authentication created.
Still didn’t work.
In the command line window where i started Gogs, “gogs web”, when I try to login with a domain user, i do see entries like these:
[Macaron] date time : Started POST /user/login for IP
[Macaron] date time : Completed POST /user/login 200 OK in 15.6ms

Please help,

Thanks,
Daniel


#2

Hi,

First of all, start Gogs as ./gogs web not gogs web if you are not using any daemon service.

Secondly, … open your path/to/gogs/log/gogs.log and give more information about why your LDAP auth failed, not “doesn’t work”.


#3

Hi Daniel,

I asked one of those questions that you mentioned. With a lot of effort of two developers we managed to configure LDAP in GOGS. Our automation script for this could be found here: https://github.com/syncloud/gogs/blob/master/hooks/gogs_hooks.py#L245
Sorry, it’s a little bit in the context of Syncloud project. At Syncloud we fully automate installation and configuration of GOGS. The code above is doing POST request to configure GOGS to work with our LDAP server.
Hope it would help you.

Vladimir


#4

Hi,

  1. ./gogs web does not work, i get the error:
    ‘.’ is not recognized as an internal or external command,
    operable program or batch file.

  2. I get the following error in the log file after the sign in fails:
    [ERROR] […kg/auth/ldap/ldap.go:188 SearchEntry()] LDAP connect failed for ‘192.168.1.3’: LDAP Result Code 200 “”: read tcp 192.168.1.50:52003->192.168.1.3:389: wsarecv: An existing connection was forcibly closed by the remote host.

Thanks,
Daniel