我能够查询活动目录/ldap 以获取用户信息以及自定义属性。但是,我想知道返回的每个属性的基础 DataType/attributeSyntax。另一个问题是,如果它不包含任何值,查询将不会返回属性本身。因此,如果可以获取属性及其各自的 DataType,那么它为我提供了在准备最终输出对象时基于 DataType 设置默认值的灵活性。
例如: 1. 我查询 AD 以查找具有, , ,foo
属性的用户givenName
mail
myCustom1
myCustom2
{
givenName : "foo foo",
mail : "foo@boo.com",
myCustom1 : "TRUE"
}
但可能不包含myCustom2
,因为它不包含 AD 中的值。
- 获取属性的语法
givenName
,mail
,myCustom1
,myCustom2
{
givenName : unistring,
mail : unistring,
myCustom1 : boolean,
myCustom2 : integer,
}
- 使用上面我可以映射第一个结果并将最终对象准备为
{
givenName : "foo foo"
mail : "foo@boo.com"
myCustom1 : "TRUE"
myCustom2 : //usingHelperFunctionGetDefaultValueFor -> myCustom2
}