For testing purposes I started to use in-memory ldap server
val config = InMemoryDirectoryServerConfig(baseDn)
config.addAdditionalBindCredentials("cn=$LOGIN", PASSWORD)
config.schema = null
val server = InMemoryDirectoryServer(config)
val importFromLDIF = server .importFromLDIF(
true,
ResourceUtils.getFile("classpath:dump.ldif"),
)
ds.startListening()
I wanted to test the case when I change userPrincipalName
with userPrincipalName
which already in use by another user.
Expected result - server will respond with error
Actual result - userPrincipalName
was successfully changed
On real server I get an error. Is there way to make the same behaviour on in-memory ldap server ?
config.schema = null
? There is a mechanism for validating entries against the (default if not specified otherwise) schema. Also, is the expected error "entryAlreadyExists (68)" (ie. dn already exists) or do you need a specific constraint on the cn attribute regardless of the full dn ? – Mezzotintconfig.schema = null
because I want to import some data from my existing samba server. More context could be found here: #76739606 Without this line - import fails and I don't understand what should I put instead of null. Is there way to export schema from existing samba server? 2. "entryAlreadyExists (68)" will be fine although I see a different issue if I try to changeuserPrincipalName
(it was a typo in a topic - edited): – Marquardtldapsearch ... -LLL -s base -b '' 'subschemaSubentry'
, thenldapsearch ... -LLL -s base -b <dnFromStep1> '*' '+' > schema.ldif
. In fact, the most straightforward way would be to connect to your AD and read the schema using ldap-sdk directly (why didn't I think about that in the first place is another question.. though I haven't tested) :ds.getSchema().getSchemaEntry().toLDIFString()
. – MezzotintDo you have any other subschemaSubentry ?
I am not sure how to check it but I can provide couple of screenshots. Hope it will answer the question – Marquardt