Gogs and windows active directory integration



I’m trying to get GOGS to work with windows active directory.
I’ve searched this forum and the internet for a solution here:

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
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,




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”.


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.




  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 ‘’: LDAP Result Code 200 “”: read tcp> wsarecv: An existing connection was forcibly closed by the remote host.