Tagged: , ,

This topic has 3 replies, 2 voices, and was last updated 7 years, 1 month ago by meyerbro.

  • Author
  • #5662

    Hello guys, I’m here again.

    I’m having some difficulties to create an user in LDAP using the OpenIDM interface.

    As I have to add posixAccount in accountObjectClasses and it is a pre-requisite to posixAccount that the user must have an uidNumber, which can be assigned or generated by auto increment, how can I do that with OpenIDM?


    • This topic was modified 7 years, 2 months ago by Peter Major.

    Is it possible to have a global variable representing a number which I can use for the next user id and then increment it after a new user creation?



    Hi Felipe,
    Yes. There are a few ways to do this. You could have OpenIDM do the autoincrementing via its script or leave the task to the openidm’s repo database (like an autoincrement type column). There are pros and cons to each and you may need to weigh it based on your use cases.
    If you need OpenIDM scripts to do this, you could use a openidm config object to create and store the last auto-incremented number upon each user creation. Simple example of how you would read that config object (also available in integrator’s gude):
    var idcache = openidm.read(“config/myidcache”);
    var mapObj = {“_rev”: “0”, “_id”: “55555”};
    openidm.update(“config/idcache”, “0”, mapObj);

    If the creation is happening via ui you would need to put this code into script/ui/onCreate-user-set-default-fields.js
    and then assign the value to the userName field. Something like
    object.userName = mapObj._id
    In your case above, you would then map this userName field in the repo to you ldap attribute of your choice within the posixAccount class. Hope this helps.


    Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?