vforteli/Flexinets.Ldap.Server

Adding more attributes to search result

Opened this issue · 0 comments

Thank you for your grate and useful application, from what I have read in articles "LDAP query page control allows a client to control the rate at which an LDAP server returns the results of an LDAP search operation" so as you can see in below screenshot in real LDAP there is control in search result , I made decision to ask a question separately than #4 , I should to thank you for your quick response.

You know we are using a system which can be integrated with LDAP server, when we config that to a real LDAP it works but when it is config-ed to use custom LDAP server it does not work, everything untill here is nice but one thing remained that I think is important for our LDAP consumer system, for this reason I think I have to make a response just like the first capture, for example in real LDAP there is an attribute in searchResDone named control

sc

1- How control can be added to search result as attribute or something:

LCore.LdapPacket response = new LCore.LdapPacket(MessageID);
var searchAttribSuccess = new LCore.LdapResultAttribute(LCore.LdapOperation.SearchResultDone, LCore.LdapResult.success); 
// Add control to search result done or something
response.ChildAttributes.Add(searchAttribSuccess);

2- And how can I make userCertificate attribute in C#, or can I dump static certificate for all users as below?:

Byte[] certBytes = (Byte[])result.Properties["userCertificate"][0]; 
X509Certificate2 certificate  = new X509Certificate2(certBytes);
result.ChildAttributes.Add(new LCore.LdapAttribute(LCore.UniversalDataType.OctetString, certificate));

the first question is important for me please guide if you can.

any help would be truly appreciated.

Thanks in Advance.