OpenLDAP slapd 2.5.13+dfsg-5 Import user via json format

Cartmen Bro tftlegal at gmail.com
Tue Jan 9 18:27:45 GMT 2024


Hi!
Please tell me, is it possible in OpenLDAP: slapd 2.5.13+dfsg-5 (Feb 8 2023
01:56:12) to add users from a data array in json format?
For example, I can add a user from the user.ldif file without any problems
(See contents below)
"dn: uid=fedor,ou=Service,dc=ldap,dc=test,dc=loc
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
objectClass: ldapPublicKey
objectClass: userSecurityInformation
description: fedora-39-default_20231118_amd64.tar.xz | Fedora39
uid: fedor
cn: fedor
givenName: fedor
sn: fedor
userPassword: {SSHA}z3glB2EgLkQaUiiXXJLzFgQubzlLNWJn
loginShell: /bin/bash
uidNumber: 20131
gidNumber: 20131
homeDirectory: /home/fedor
shadowMax: 60
shadowMin: 1
shadowWarning: 7
shadowInactive: 7
shadowLastChange: 0
sshPublicKey: ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAACAQCwg6i4IQ87enl6fHV0TcM0N3jHnN03tKfm+Y+2jXNNcn4Zoc46eisTygyT6cm2jVl+DuTpR/cl25tUEyUPsvmLrfPcmMGmGJG6AcVx
LKhpd25uJl1UYpSXiHib6+mWH4XwnDE9CTme+LHHsJH/5kui11pEDJh82kZL5Nj5furS8GgpvOEMHCCQ1TVP4+ASToQHM6HZKbbisIpGVo0nksjBpXz3jvinAjUa2NeEAeA4ucSCq98JwgtwB7AAUqD6+s
agpQ96qgKXsXrKAS7EscSsH6Zy5H9OT0eW+dC9rX+vEDwohjiI9LNZhDI+Ruo77nJd/MDrIJAZRcsYrmKnNIh6dFp9nK5T9Df8v02Knu1pYub4DJX87nhMJzvNNVh/nZeS/oMZcropJhrxCc
zuyj9M8W6YLMW122GUnW5pKTWg9ethV9tGEtgYBW0xDooAmtaAp/3ggImcPzKkwArd2qTUf/2e4be9jvb/iJgPSYhxuMQ93vhVd2O/JieKxJgUUNw5kbh8458fOeIaHbCPdPE8RJY2jVUNmka
xSnzo+5JQ+VGCuUJ8j9IQkGrjyG6y87fFjfTepW7SuBdI15VKdLrU5aa6PH9awmvqg/d8VIYZv73E5rHLk5CQayQOerTtevGH9XCEW9Ublvbzx31eOm5wvB36HQ
+YSpFKMnAgrutfVQ== root at c1.test.loc

dn: cn=fedor,ou=Groups,dc=ldap,dc=test,dc=loc
objectClass: posixGroup
cn: fedor
gidNumber: 20131
memberUid: fedor"

1. Is it possible to add a user with his attributes in LDAP JSON format?
2. Are there any built-in conversion tools? If you don’t mind, could you
please tell me what the scheme for adding data from the example to LDAP
will look like?
I saw mention of using the command below, but it doesn't work:
ldapjson -x -D "cn=admin,dc=ldap,dc=test,dc=loc -W -f users.json | ldapadd
-q -
The essence of the idea is that the client (which contains information
about users) can send the LDAP server an array of users.json data. I would
like to understand how to add it to LDAP. Thank you for your answer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-openldap-devel/attachments/20240109/ea6dc78f/attachment.htm>


More information about the Pkg-openldap-devel mailing list