Nerdier

Adjective: Comparative form of nerdy: more nerdy.

LDAP Authentication for Gitlab.

If you haven’t heard of it, gitlab is a super awesome self hosted alternative to github and the like.  It’s runs on ruby on rails and looks nice and pretty. I will cover my installation of it on a work server at a later date, in this post I just want to cover the issue we had with LDAP auth and the fix.

While trying to get the auth working, we kept encountering the issue with it saying “invalid credentials” even though the details were correct in the config file. It turns out that the omniauth_ldap gem needs to be updated to the latest version, which the gitlab gemfile doesn’t provide.

The way to fix this is to edit your Gemfile, in the /home/git/gitlab directory and set the omniauth_ldap bit to look like this;

# LDAP Auth
#gem 'gitlab_omniauth-ldap', '1.0.2', require: "omniauth-ldap"
gem 'gitlab_omniauth-ldap', :git => 'git://github.com/gitlabhq/omniauth-ldap.git', require: "omniauth-ldap"

Save/Exit the file and then run;

bundle install

This should update/install the required version.

Then you just need to restart gitlab and you’re good to login!

Leave a Reply

Your email address will not be published. Required fields are marked *