New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable IntegratedAuthentication (ActiveDirectory) for MSSQL #5349

road42 opened this Issue Nov 16, 2018 · 2 comments


2 participants

road42 commented Nov 16, 2018

  • Gitea version (or commit ref): latest
  • Git version: 2.19.1
  • Operating system: Windows Server 2012 R2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:


I'd like to use the integrated authentication for a mssql database. I already looked into the sourcecode:

On this line the connectionString is created:

connStr = fmt.Sprintf("server=%s; port=%s; database=%s; user id=%s; password=%s;", host, port, DbCfg.Name, DbCfg.User, DbCfg.Passwd)

It seems that gitea uses xorm as or-mapper.
xorm uses the mssql-driver from:

The driver has the following documentation:

user id - enter the SQL Server Authentication user id or the Windows Authentication user id in the DOMAIN\User format. On Windows, if user id is empty or missing Single-Sign-On is used.


I already tried to leave "user id" and/or "password" in the configuration empty, but it did not connect to the database.

It should be possible to leave the password and username field empty to connect to a mssql database.


This comment has been minimized.


lafriks commented Nov 16, 2018

I don't think driver supports integrated authentication


This comment has been minimized.


lafriks commented Nov 16, 2018

To use AD auth you still need to provide username and password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment