Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #2012

Closed
Open
Created 12 years ago by Administrator@rootOwner
  • New issue

  • Report abuse

  • New issue

  • Report abuse

Feature Request: Make git http access compatible with ldap authentication

Closed

Feature Request: Make git http access compatible with ldap authentication

Created by: sharpyy

It seems that the git http access currently does not work properly when using ldap authentication.

It would be nice also to have a way to enable/disable the 2 different protocols. Some people might want to only use http while other prefers to use the git protocol.

Thank you in advance.

Linked issues
0


  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: elvanja

    I've tried investigating on how to implement this. Located the clone/push authorization logic in /lib/gitlab/backend/grack_auth.rb. It seamed easy enough, the flow would be something on the lines of:

    • get user by username / email
    • if user has providers, try authenticating with Devise
    • otherwise see if the password matches

    I believe this is quite enough. This part needs not create users from LDAP, just authenticate them if the user is of LDAP type. It means people will need to login once to Gitlab, but that is OK in my opinion.

    I had trouble figuring out how this works. Correct me if I am wrong, but Grack route is the one that uses this code? If so, it bypasses Devise totally. Tried to figure out how to invoke Devise authentication but it seams that there is no easy way of doing this - Devise requires callback controller, which is outside of this code's scope.

    The solutions that came to mind:

    • somehow use Devise authentication outside of regular Rails controller scope
    • use Omniauth directly
    • use some other LDAP specific gem
    • make Gitolite HTTP accessible: https://github.com/sitaramc/gitolite-doc/blob/master/contrib/ssh-and-http.mkd

    Unfortunately, couldn't figure out a way to use any of those. I'd like to use Devise if possible, since it will ensure other providers behave the same (not just LDAP).

    Also, haven't figured why this auth code is called twice during a http clone action?

    I'd really like to help and wouldn't mind giving a hand, but am totally lost and some help or a push in the right direction would be great!

    By Administrator on 2012-12-01T16:40:41 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: elvanja

    Found a way to enable LDAP authentication for HTTP.

    Fix for latest version: https://gist.github.com/4195057 Fix for stable version: https://gist.github.com/4195080

    The main idea is to use http://net-ldap.rubyforge.org/Net/LDAP.html to authenticate user directly against LDAP, while using Gitlab provided LDAP settings. Latest version assumes username for the User is filled in when user is added after first time login (or updated later). Stable fix works a bit differently, it first tries to authenticate user with LDAP and uses the provided user email to continue. More details can be found in the provided gists.

    If you find this useful, I will create a pull request easily. The stable fix is currently operational in my organisation and it works nicely. Mind you, it would probably be best to unify access (ssh or http) and use the same providers in both cases, then this wouldn't be needed at all, but that is probably topic for another time and place.

    Let me know how you feel about this :-)

    By Administrator on 2012-12-03T13:42:45 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: SaitoWu

    Hi, can u make a PR on this one?

    I don't have LDAP env, and I will merge it if it works.

    By Administrator on 2012-12-04T09:42:38 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: elvanja

    Sure thing, opened up pull request https://github.com/gitlabhq/gitlabhq/pull/2167 Let me know how it goes...

    By Administrator on 2012-12-04T10:20:48 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: senny

    We don't use the Github issue tracker for feature requests. Please use http://feedback.gitlab.com/ for this purpose. Have a look at the contribution guidelines for more information.

    I'm closing this one as it is a feature request. We still have the PR's to remember us.

    By Administrator on 2013-04-18T09:09:40 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
None
Assign to
Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Due date
None
None
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only team members with at least Reporter access will be able to see and leave comments on the issue.

Lock issue
Unlocked
1
1 participant
user avatar
Reference: gpt/large_projects/gitlabhq1#2012

Menu

Projects Groups Snippets
Help