Active Directory LDAP 身份验证 Git Windows Server 2008

发布于 2024-12-22 05:31:44 字数 2886 浏览 0 评论 0 原文

我正在尝试通过 Windows 服务器上的 apache 设置 git。我正在使用 msysgit 版本 1.7.7.1-preview20111027。我已经完成了大部分工作,但通过 http 推送并通过 Active Directory 进行身份验证是一个问题。

这是我的 httpd.conf:

<目录/>
    全部允许


<目录C:/GitRepos>
    AuthName“Git 存储库”
    AuthType 基本
    AuthBasicProvider ldap
    AuthzLDAP权威
   AuthLDAPUrl ldap://server/DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)
    AuthLDAPBindDN“CN=用户,OU=某个单元,DC=域,DC=com”
    AuthLDAPBindPassword 密码
    AuthLDAPGroupAttributeIsDN 关闭
    AuthLDAPGroupAttribute 成员
   需要 ldap 组 CN=ADGroup,OU=unit1,OU=unit2,DC=domain,DC=com
    满足任意


SetEnv GIT_PROJECT_ROOT C:/GitRepos
SetEnv GIT_HTTP_EXPORT_ALL
# SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
ScriptAliasMatch \
       "(?x)^/(.*/(HEAD | \
             信息/参考 | \
               对象/(info/[^/]+ | \
                    [0-9a-f]{2}/[0-9a-f]{38} | \
            ;        pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
            git-(上传|接收)-pack))$" \
            "C:/Program Files (x86)/git/libexec/git-core/ git-http-backend.exe/$1"


    AuthName“Git 存储库”
    AuthType 基本
    AuthBasicProvider ldap
    AuthzLDAP权威
   AuthLDAPUrl ldap://server/DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)
    AuthLDAPBindDN“CN=用户,OU=某个单元,DC=域,DC=com”
    AuthLDAPBindPassword 密码
    AuthLDAPGroupAttributeIsDN 关闭
    AuthLDAPGroupAttribute 成员
   需要 ldap 组 CN=ADGroup,OU=unit1,OU=unit1,DC=domain,DC=com
    满足任意

如果我取消注释:

# SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
I can push over http, but a user can type anything in for a password and the ldap authorization doesn't limit the repositories to just the one Active Directory group.

我的设置是否不正确?

I'm trying to setup git through apache on a windows server. I'm using msysgit version 1.7.7.1-preview20111027. I've gotten most of it working but pushing over http and authenticating through Active Directory is an issue.

Here's my httpd.conf:

<Directory />
    Allow from All
</Directory>

<Directory C:/GitRepos>
    AuthName "Git Repositories"
    AuthType Basic
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative on
    AuthLDAPUrl ldap://server/DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)
    AuthLDAPBindDN "CN=User,OU=someunit,DC=domain,DC=com"
    AuthLDAPBindPassword password
    AuthLDAPGroupAttributeIsDN off
    AuthLDAPGroupAttribute member
    Require ldap-group CN=ADGroup,OU=unit1,OU=unit2,DC=domain,DC=com
    Satisfy any
</Directory>

SetEnv GIT_PROJECT_ROOT C:/GitRepos
SetEnv GIT_HTTP_EXPORT_ALL
# SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
ScriptAliasMatch \
        "(?x)^/(.*/(HEAD | \
                info/refs | \
                    objects/(info/[^/]+ | \
                        [0-9a-f]{2}/[0-9a-f]{38} | \
                        pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                git-(upload|receive)-pack))$" \
                "C:/Program Files (x86)/git/libexec/git-core/git-http-backend.exe/$1"

<LocationMatch "^/.*/git-receive-pack$">
    AuthName "Git Repositories"
    AuthType Basic
    AuthBasicProvider ldap
    AuthzLDAPAuthoritative on
    AuthLDAPUrl ldap://server/DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)
    AuthLDAPBindDN "CN=User,OU=someunit,DC=domain,DC=com"
    AuthLDAPBindPassword password
    AuthLDAPGroupAttributeIsDN off
    AuthLDAPGroupAttribute member
    Require ldap-group CN=ADGroup,OU=unit1,OU=unit1,DC=domain,DC=com
    Satisfy any
</LocationMatch>

If I uncomment:

# SetEnv REMOTE_USER $REDIRECT_REMOTE_USER

I can push over http, but a user can type anything in for a password and the ldap authorization doesn't limit the repositories to just the one Active Directory group.

Are my settings incorrect?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

在梵高的星空下 2024-12-29 05:31:44

也许这个早期的线程可能会有所帮助:
有没有办法对 Git 服务器使用 Windows 身份验证(Active Directory)?

它没有回答您的确切问题,但可能提供使用 AD 身份验证的其他途径。

Perhaps this earlier thread may help:
Is there a way to use Windows Authentication (Active Directory) for a Git server?

It doesn't answer your exact question but may provide other avenues for using AD authentication.

薄情伤 2024-12-29 05:31:44

我已经成功地通过 https 完成了它,但最好与 ssh 一起使用。

无论如何,我有一些关于俄语的文章:

I have succesfully made it over https, but its best working with ssh.

anyway I have some articles on russian:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文