【问题标题】:How to add geolocation attributes to an LDAP account如何将地理位置属性添加到 LDAP 帐户
【发布时间】:2017-02-13 11:51:52
【问题描述】:

我有一个 LDAP 用户数据库映射为 posixAccount、inetOrgPerson 和 top 类的对象。

我需要为用户添加纬度和经度属性。但是,这些属性似乎不存在于这些类中(也不存在于其他类中)。 inetOrgPerson 仅显示 postalAddress、street 等引用。

是否可以向现有 LDAP 类添加新类或新属性?还是我缺少任何其他解决方案?

我正在使用带有 phpldapadmin 的 openldap 服务器(尽管这些不是硬性限制)。

非常感谢, 艾伦

【问题讨论】:

    标签: geolocation ldap openldap


    【解决方案1】:

    虽然可以将属性类型添加到标准 (RFC) 对象类,但您不应该这样做。 vCard-4.0 草案方便地定义了属性 latLong (section 3.14)。您创建一个具有该属性类型的辅助 objectClass,您以后可以使用该属性类型将 GPS 坐标添加到您的条目中。

    创建一个文件“geolocation.schema”,如:

    # latLong
    # Represents a geographical location using the WGS84 data coordinates
    # as used by GPS, like: -33.92;151.28
     attributetype ( 1.3.6.1.4.1.33592.1.3.14 NAME 'latLong'
       EQUALITY caseIgnoreMatch
       SUBSTR caseIgnoreSubstringsMatch
       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
     )
    
    # geoLocation
    # The geoLocation auxiliary class allows GPS coordinates to be added
    # to an object
     objectclass ( your-company-oid-prefix-as-provided-by-IANA.your-oc-convention 
       NAME 'geoLocation'
       DESC ''
       AUXILIARY
       MAY ( latLong )
     )  
    

    在您的 slapd.conf 文件中,为您的架构文件添加 include 语句。重新启动 LDAP 服务器后,新的对象类可用。

    如果您的组织还没有 OID 前缀,get one。对于测试,您可以伪造一个。

    已输入但未测试...

    【讨论】:

    • marabu,非常感谢您的回答!它没有按原样工作,但我会进一步分析并发布问题所在。好像缺少 geolocation.diff 文件。
    • 如何生成 geolocation.ldif 文件?
    • 作为 OpenLDAP 管理员,找到包含架构扩展名的文件夹,将上面的架构条目复制并粘贴到您首选的文本编辑器中,然后另存为 geolocation.schema。不要忘记调整 geoLocation OID。
    猜你喜欢
    • 1970-01-01
    • 2018-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-03
    • 2011-09-17
    相关资源
    最近更新 更多