Tagged: , ,

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

  • Author
    Posts
  • #5662
     meyerbro
    Participant

    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?

    Thanks,
    Felipe

    #5677
     meyerbro
    Participant

    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?

    Thanks,
    Felipe

    #5703
     ssripathy
    Participant

    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):
    READ
    var idcache = openidm.read(“config/myidcache”);
    UPDATE
    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.
    Tchau!
    -sridhar

    #5717
     meyerbro
    Participant

    Thank you!

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

You must be logged in to reply to this topic.

©2021 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?