Gerrit對接LDAP

當前部署的gerrit實例使用的 HTTP基本身份驗證衬以,即gerrit.config中的auth.type 字段為 HTTP

1届良、修改gerrit.config

[auth]
        type = LDAP
        gitBasicAuthPolicy = LDAP
[ldap]
        server = ldap://ldap.mydomain.com:636
        username = <user_uid>

        accountBase = ou=用戶,dc=byd,dc=com
        accountFullName = displayName
        accountEmailAddress = mail

2翘贮、編輯secure.config

[ldap]
    password = <user_password>

3迂曲、修改修改docker-compose.yml覆享,注釋掉 httpd部分
4佳遂、重啟

# 停止
docker-compose down
# 啟動
docker-compose up -d

5、訪問地址

  • HTTP_LDAP
    Exactly like HTTP (above), but additionally Gerrit pre-populates a user’s full name and email address based on information obtained from the user’s account object in LDAP. The user’s group membership is also pulled from LDAP, making any LDAP groups that a user is a member of available as groups in Gerrit. Hence the _LDAP suffix in the name of this authentication type. Gerrit does NOT authenticate the user via LDAP.

    與上面的HTTP完全相同撒顿,但Gerrit根據(jù)從LDAP中的用戶帳戶對象獲得的信息預填充用戶的全名和電子郵件地址丑罪。用戶的組成員關系也從LDAP中提取,使得用戶所屬的任何LDAP組都可以作為Gerrit中的組使用凤壁。因此吩屹,在此身份驗證類型的名稱中使用_LDAP后綴。Gerrit不通過LDAP認證用戶拧抖。

  • CLIENT_SSL_CERT_LDAP
    This authentication type is actually kind of SSO. Gerrit will configure Jetty’s SSL channel to request the client’s SSL certificate. For this authentication to work a Gerrit administrator has to import the root certificate of the trust chain used to issue the client’s certificate into the <review-site>/etc/keystore. After the authentication is done Gerrit will obtain basic user registration (name and email) from LDAP, and some group memberships. Hence the _LDAP suffix in the name of this authentication type. Gerrit does NOT authenticate the user via LDAP. This authentication type can only be used under hosted daemon mode, and the httpd.listenUrl must use https:// as the protocol. Optionally, certificate revocation list file can be used at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.

  • LDAP
    Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.

    The actual username used in the LDAP simple bind request is the account’s full DN, which is discovered by first querying the directory using either an anonymous request, or the configured ldap.username identity. Gerrit can also use kerberos if ldap.authentication is set to GSSAPI.

    If auth.gitBasicAuthPolicy is set to HTTP, the randomly generated HTTP password is used for authentication. On the other hand, if auth.gitBasicAuthPolicy is set to HTTP_LDAP, the password in the request is first checked against the HTTP password and, if it does not match, it is then validated against the LDAP password. Service users that are internal-only are authenticated by their HTTP passwords.

    Gerrit提示用戶輸入用戶名和密碼煤搜,然后通過對配置的ldap.server執(zhí)行簡單綁定來驗證。在這種配置中唧席,web服務器不參與用戶身份驗證過程擦盾。

    LDAP簡單綁定請求中使用的實際用戶名是帳戶的完整DN,這是通過使用匿名請求或配置的LDAP首先查詢目錄來發(fā)現(xiàn)的淌哟。用戶名的身份迹卢。Gerrit也可以在ldap中使用kerberos。鑒權設置為GSSAPI徒仓。

    如果身份驗證腐碱。giitbasicauthpolicy設置為HTTP時,使用隨機生成的HTTP密碼進行鑒權蓬衡。另一方面喻杈,它是正確的彤枢。giitbasicauthpolicy設置為HTTP_LDAP,則首先根據(jù)HTTP密碼檢查請求中的密碼筒饰,如果不匹配缴啡,則根據(jù)LDAP密碼進行驗證。僅限內(nèi)部的業(yè)務用戶使用HTTP密碼進行認證瓷们。

  • LDAP_BIND
    Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.

    Unlike LDAP above, the username used to perform the LDAP simple bind request is the exact string supplied in the dialog by the user. The configured ldap.username identity is not used to obtain account information.

參考鏈接:
https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.5/config-gerrit.html#ldap

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末业栅,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子谬晕,更是在濱河造成了極大的恐慌碘裕,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,858評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件攒钳,死亡現(xiàn)場離奇詭異帮孔,居然都是意外死亡,警方通過查閱死者的電腦和手機不撑,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,372評論 3 395
  • 文/潘曉璐 我一進店門文兢,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人焕檬,你說我怎么就攤上這事姆坚。” “怎么了实愚?”我有些...
    開封第一講書人閱讀 165,282評論 0 356
  • 文/不壞的土叔 我叫張陵兼呵,是天一觀的道長。 經(jīng)常有香客問我腊敲,道長击喂,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,842評論 1 295
  • 正文 為了忘掉前任兔仰,我火速辦了婚禮茫负,結果婚禮上,老公的妹妹穿的比我還像新娘乎赴。我一直安慰自己忍法,他們只是感情好,可當我...
    茶點故事閱讀 67,857評論 6 392
  • 文/花漫 我一把揭開白布榕吼。 她就那樣靜靜地躺著饿序,像睡著了一般。 火紅的嫁衣襯著肌膚如雪羹蚣。 梳的紋絲不亂的頭發(fā)上原探,一...
    開封第一講書人閱讀 51,679評論 1 305
  • 那天,我揣著相機與錄音,去河邊找鬼咽弦。 笑死徒蟆,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的型型。 我是一名探鬼主播段审,決...
    沈念sama閱讀 40,406評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼闹蒜!你這毒婦竟也來了寺枉?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,311評論 0 276
  • 序言:老撾萬榮一對情侶失蹤绷落,失蹤者是張志新(化名)和其女友劉穎姥闪,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體砌烁,經(jīng)...
    沈念sama閱讀 45,767評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡筐喳,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,945評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了往弓。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片疏唾。...
    茶點故事閱讀 40,090評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡蓄氧,死狀恐怖函似,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情喉童,我是刑警寧澤撇寞,帶...
    沈念sama閱讀 35,785評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站堂氯,受9級特大地震影響蔑担,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜咽白,卻給世界環(huán)境...
    茶點故事閱讀 41,420評論 3 331
  • 文/蒙蒙 一啤握、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧晶框,春花似錦排抬、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,988評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至侵贵,卻和暖如春届搁,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,101評論 1 271
  • 我被黑心中介騙來泰國打工卡睦, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留宴胧,地道東北人。 一個月前我還...
    沈念sama閱讀 48,298評論 3 372
  • 正文 我出身青樓表锻,卻偏偏與公主長得像牺汤,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子浩嫌,可洞房花燭夜當晚...
    茶點故事閱讀 45,033評論 2 355

推薦閱讀更多精彩內(nèi)容