【gerrit】Invalid username or pass
2019-12-31 本文已影响0人
熊本猫
背景
gerrit使用的LDAP域账号登录,近期有用户反馈域账号无法登录,报错Invalid username or password.
但是他们使用同样的账号密码可以登录其他平台。
解决
因为用户可以登录其他地方,所以怀疑是gerrit上面的用户密码未同步最新的数据。开始找了RESTAPI想删掉用户重新添加,可是DELETE /a/accounts/{account_id}/active
一直报错。
后来灵机一动想起来,我们有多个域认证服务器,是不是在gerrit.config里面换一个ldap地址就可以让它重新同步了呢?改过之后果然生效了~
gerrit.config示例
[ldap]
server = ldap://server2.com
#server = ldap://server1.com
username = xxx@xxx.com
accountBase = DC=xxx,DC=com
accountPattern = (&(objectClass=person)(sAMAccountName=${username}))
accountFullName = Description
accountEmailAddress = mail
accountSshUserName = sAMAccountName
groupName = cn