Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup admin user with gitlab with LDAP authentication?

Tags:

I've just setup gitlab, but I'm completely lost with regards to admin user. The wiki seems silent about this topic, and google hasn't been of help either.

So, how do I setup admin users with gitlab on LDAP authentication?

like image 865
Daniel C. Sobral Avatar asked Aug 01 '12 14:08

Daniel C. Sobral


People also ask

What is LDAP username in GitLab?

The LDAP DN is associated with existing GitLab users when: The existing user signs in to GitLab with LDAP for the first time. The LDAP email address is the primary email address of an existing GitLab user. If the LDAP email attribute isn't found in the GitLab user database, a new user is created.

How does LDAP authentication between a client and server work?

In short, a client sends a request for information stored within an LDAP database along with the user's credentials to an LDAP server. The LDAP server then authenticates the credentials submitted by the user against their core user identity, which is stored in the LDAP database.


2 Answers

You can also set admin permissions to a user by doing something like this in the rails console:

User.find_by_email("[email protected]") do |i|     i.admin = true     i.save end 
like image 74
morgents Avatar answered Sep 19 '22 20:09

morgents


This is what I did to make a LDAP (or Windows AD) user vikas as admin.

First login on GitLab portal and logout, then run the below commands.

gitlab-rails console production u = User.where(id: 1).first u.admin = true u.save! exit 

After running the above commands, login again and now your will have admin privileges for vikas AD user.

like image 22
vikas027 Avatar answered Sep 17 '22 20:09

vikas027