亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

Console LDAP 配置解密

之前通过短视频向大家介绍了 Console 如何集成 LDAP,但很多小伙伴反映按照视频里的配置后不成功。今天就结合小伙伴们反映的问题来跟大家详细介绍一下。
Console LDAP 完整的配置参数如下:

名称 类型 说明
host string LDAP 服务器地址
port int LDAP 服务器端口,默认 389
tls bool LDAP 服务器是否为 TLS 安全传输协议,默认 false
bind_dn string 执行 LDAP 查询的用户信息
bind_password string 执行 LDAP 查询的密码信息
base_dn string 过滤 LDAP 用户的根域
user_filter string 过滤 LDAP 用户的查询条件,默认 (uid=%s)
uid_attribute string 用于用户 ID 的属性,默认 uid
group_attribute string 用于用户组的属性,默认 cn
role_mapping.uid map 用于基于用户 UID 的权限映射
role_mapping.group map 用于基于用户 Group 的权限映射

接下来结合 debug 模式的调试信息(-deubg -log debug)重点说明一下:

LDAP Result Code 49 "Invalid Credentials": 80090308: LdapErr: DSID-0C0903D3, comment: AcceptSecurityContext error, data 52e, v3839

出现上面错误有两种可能:1、执行 LDAP 查询的账户信息有误;2、登陆使用的账户信息有误

第一种情况涉及配置中的 bind_dn 和 bind_password。
其中 bind_dn 有两种写法:1、cn=serviceuser,ou=svcaccts,dc=glauth,dc=com;2、[email protected]
(注:如果是使用 AD,最好使用第二种写法。);如果 bind_dn 没问题,请检查账户的密码是否正确。

第二种情况请验证账户信息。

LDAP Result Code 201 "Filter Compile Error": ldap: finished compiling filter with extra at end

出现这个错误说明 user_filter 没有配置正确。user_filter 需配置一个过滤条件,可在 LDAP 中匹配到唯一记录(在过滤条件中使用“%s”引用登陆的账户名)。

authorize result: false, user: &{{[email protected] <nil> <nil>} ldap [email protected] [email protected]    [] [] 0x4003721740}, err: no privilege assigned to this user:[email protected]

出现这个错误说明赋权时出现异常,这里涉及到四个参数(uid_attribute、group_attribute、role_mapping.uid、role_mapping.group)的配置。

这里需要注意:group_attribute 及 uid_attribute 需配置 LDAP 账户信息中存在的属性字段,才能在后面的 role_mapping 里赋权成功。

注:role_mapping.uid、role_mapping.group 配置的值中不能包含特殊字符“.”。

點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消