我在ForgeRock openIDM中创建了一个自定义用户对象。在openIDM中创建用户时,它会在openDJ中同步。但是当我更新时,用户数据没有被同步。
当我删除openIDM和openDJ的映射并创建新的映射时,sync工作正常一段时间后再停止工作。我必须删除旧的映射并创建新的映射。有什么方法可以解决这个问题吗?如果有人知道修复,请帮助我。
我在openIDM中对托管/用户到system / ldap /帐户的Sync.json映射如下所示,
{
"enableSync" : true,
"source" : "managed/user",
"onCreate" : {
"source" : "target.dn='uid='+source.loginId+','+source.ou",
"type" : "text/javascript"
},
"name" : "managedUser_sourceLdapAccount",
"target" : "system/ldap/account",
"properties" : [
{
"source" : "givenName",
"target" : "givenName"
},
{
"source" : "description",
"target" : "description"
},
{
"source" : "familyName",
"target" : "familyName"
},
{
"source" : "gender",
"target" : "gender"
},
{
"source" : "mobilePhone",
"target" : "mobilePhone"
},
{
"source" : "emailAddress",
"target" : "mail"
},
{
"source" : "homePhone",
"target" : "homePhone"
},
{
"source" : "workPhone",
"target" : "workPhone"
},
{
"source" : "_id",
"target" : "userUUID"
},
{
"source" : "middleName",
"target" : "sn"
},
{
"source" : "birthDay",
"target" : "birthDay"
},
{
"source" : "country",
"target" : "pcountry"
},
{
"target" : "cn",
"source" : "",
"transform" : {
"source" : "source.displayName||(source.givenName+' '+source.familyName)",
"type" : "text/javascript"
}
},
{
"target" : "userPassword",
"transform" : {
"source" : "openidm.decrypt(source)",
"type" : "text/javascript"
},
"source" : "password",
"condition" : {
"source" : "object.password!=null",
"type" : "text/javascript"
}
},
{
"source" : "displayName",
"target" : "displayName"
}
],
"policies" : [
{
"action" : "CREATE",
"situation" : "ABSENT"
},
{
"action" : "IGNORE",
"situation" : "ALL_GONE"
},
{
"action" : "EXCEPTION",
"situation" : "AMBIGUOUS"
},
{
"action" : "UPDATE",
"situation" : "CONFIRMED"
},
{
"action" : "UPDATE",
"situation" : "FOUND"
},
{
"action" : "EXCEPTION",
"situation" : "FOUND_ALREADY_LINKED"
},
{
"action" : "EXCEPTION",
"situation" : "LINK_ONLY"
},
{
"action" : "UNLINK",
"situation" : "MISSING"
},
{
"action" : "IGNORE",
"situation" : "SOURCE_IGNORED"
},
{
"action" : "EXCEPTION",
"situation" : "SOURCE_MISSING"
},
{
"action" : "IGNORE",
"situation" : "TARGET_IGNORED"
},
{
"action" : "EXCEPTION",
"situation" : "UNASSIGNED"
},
{
"action" : "DELETE",
"situation" : "UNQUALIFIED"
}
]
}
答案 0 :(得分:0)
尝试在脚本上添加“ onUpdate”,它应如下所示:
"onUpdate" : {
"source" : "target.dn='uid='+source.loginId+','+source.ou",
"type" : "text/javascript"
},
在idm文档中,他们声明仅在创建新对象时才调用onCreate。