天天看点

ldap添加自定义字段

因项目原因,需要在LDAP中配置inetOrgPerson对象类的两个自定义属性。

isAbsent 128字符内的字符串,单值

substitutes 128字符内的字符串,多值

参阅了OpenLdap的管理文档以及网上的实例之后,解决方案如下:

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'

  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则是字符串类型的语法。

objectclass  ( 2.16.840.1.113730.3.2.2

        NAME 'inetOrgPerson'

  DESC 'RFC2798: Internet Organizational Person'

        SUP organizationalPerson

        STRUCTURAL

  MAY (

...

    isAbsent $ substitutes )

  )

#

# 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

继续阅读