ldap添加自定义字段
因項目原因,需要在LDAP中配置inetOrgPerson對象類的兩個自定義屬性。
-
isAbsent 128字符內的字符串,單值
-
substitutes 128字符內的字符串,多值
參閱了OpenLdap的管理文檔以及網上的實例之后,解決方案如下:
編輯OpenLDAP的模式定義文件inetorgperson.schema,增加屬性定義
attributetype ( 2.16.840.1.113730.3.1.900
??NAME 'isAbsent'
??DESC 'whether the person is absent from work'
??EQUALITY caseIgnoreMatch
??SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128}
??SINGLE-VALUE )
attributetype ( 2.16.840.1.113730.3.1.901
??NAME 'substitutes'
??DESC 'people substitutes when absent'
??EQUALITY caseIgnoreMatch
??SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
其中2.16.840.1.113730.3.1.900和901是選擇未被使用的OID(不知道有沒有被使用過?google下吧),而1.3.6.1.4.1.1466.115.121.1.15則是字符串類型的語法。
在inetOrgPerson類中啟用這2個屬性
objectclass??( 2.16.840.1.113730.3.2.2
????????NAME 'inetOrgPerson'
??DESC 'RFC2798: Internet Organizational Person'
????????SUP organizationalPerson
????????STRUCTURAL
??MAY (
...
????isAbsent $ substitutes )
??)
在slapd.conf中啟用inetorgperson.schema
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
ucdata-path??./ucdata
include????./schema/core.schema
include????./schema/cosine.schema
include????./schema/inetorgperson.schema
include????./schema/nis.schema
重新啟動LDAP服務之后一切搞定。
本文轉自 轉身撞墻角 51CTO博客,原文鏈接:http://blog.51cto.com/chentianwang/1794626
總結
以上是生活随笔為你收集整理的ldap添加自定义字段的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OpenGL ES for Window
- 下一篇: 返璞归真的Linux BFS调度器