gstackoverflow
gstackoverflow

Reputation: 37106

Is there way to get ObjectGUID from `LDAPResult ` object?

I have a code like this for user creation:

AddRequest addRequest = new AddRequest(...
...
LDAPResult addResult = ldapConnectionPool.add(addRequest)

Is there way to get ObjectGUID from addResult field ?

Or maybe there is a way to generate this ObjectGUID on the client side and send as an argument ?

Upvotes: 0

Views: 71

Answers (1)

grawity_u1686
grawity_u1686

Reputation: 16572

Not possible with basic LDAP – 'Add' operation results do not return any data from the server to client, only a success/error code.

There are LDAP extensions, namely the "postRead" control, that would allow this – an add/modify operation with the postRead control would return the whole resulting entry – but Active Directory does not support them. (I think only OpenLDAP does.) As you're talking about ObjectGUID rather than entryUUID, I assume you're using AD rather than OpenLDAP.

So you will need to make a separate search for the DN that you just added and retrieve the objectGUID that way.

Upvotes: 1

Related Questions