0

I created a custom user object in ForgeRock openIDM. While creating user in openIDM it is synced in openDJ. But user data is not getting synced when I do update.

When I remove the mappings for openIDM and openDJ and create new mappings, sync works fine for some time and later it stops working. Again I have to remove old mappings and create new mappings. Is there any way to solve this issue? Please help me if some one knows the fix.

My Sync.json mapping for managed/user to system/ldap/account in openIDM looks like this,

{
            "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"
                }
            ]
        }
Laurent Bristiel
  • 6,819
  • 34
  • 52
Bob
  • 1
  • 1
  • what version of OpenIDM are you using? When the updates in managed user are not triggering any update in LDAP, could you check if any entry is record in the audit/recon.csv file (could help us understand is a sync is triggered but fails for some reason...) ? – Laurent Bristiel Nov 06 '15 at 08:17
  • Am using openIDM3.1.0 – Bob Nov 06 '15 at 09:38
  • Am using openIDM3.1.0. And when deleted existing recon.csv file it is not even getting created again. – Bob Nov 06 '15 at 09:59

1 Answers1

0

Try adding "onUpdate", on your script, it should look like this:

"onUpdate" : {
            "source" : "target.dn='uid='+source.loginId+','+source.ou",
            "type" : "text/javascript"
        },

In the idm documentation, they state that onCreate is only called when creating a new object.

Hamza Tahiri
  • 488
  • 3
  • 13