Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've Apache 2.2 and Gitlab 6 running. After installing OpenLDAP on Debian Wheezy and setting up Gitlab I can login to Gitlab with LDAP credentials. But I wonder if there is a way to provide LDAP login credentials from Apache 2.2 Basic Auth to Gitlab. When enabled in Apache and in Gitlab I have to login twice, nevertheless. (I will need this behaviour also for Mantis)

EDIT I made a wrong assumption. When authenticating to Apache with LDAP, this is a HTTP Basic Auth, nevertheless. So Gitlab has to accept Basic Auth credentials (HTTP_REMOTE_USER) from Apache to login user based on Gitlabs own user database. As far as I've seen, there are some efforts, but this patch is only for Gitlab 6 (I'm using version 6.2). And as you can read in next-to-last comment here, it seems, that Gitlab will develop such a function for Enterprise version.

share|improve this question

1 Answer 1

I have been having the very same problem. I wanted to authenticate through kerberos/AD and the authenticated user uses the LDAP attributes. Apache gets its credentials and sets the HTTP_REMOTE_USER and forward it to unicorn which does not know what to do with it. The solution is to force the forwarding of this variable in header, to let unicorn retrieves it, and then gitlab does the job.

RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.*)
RewriteRule . - [E=RU:%1,NS]
RequestHeader set REMOTE_USER "%{RU}e" env=RU

You may want to look at my problem which would provide more information. Currently, this is not (unfortunately) solved in my case implying Kerberos :/ But for your case it should work.

share|improve this answer
    
I've seen your approach already somewhere. Another question: could httpd.apache.org/docs/2.2/mod/mod_proxy_http.html with its option proxy-chain-auth help us? –  rabudde Nov 8 '13 at 8:21
    
That: github.com/gitlabhq/gitlabhq/issues/4817#issuecomment-28181001 does fit my needs better –  rabudde Nov 30 '13 at 22:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.