简体   繁体   中英

Add user to a Oracle LDAP group with C#

In my .net application for authentication i use Oracle LDAP (Oracle Identity Directory). And authorisation can be user base or role base. I can take user roles from LDAP. But i cant add user to a group. How can i do that?

If u can enter to odsm u'll see, users are in group with "uniquemember" attribute. So if u need that s the solution;

//Connect LDAP
var request = new ModifyRequest { DistinguishedName = roleDn };
var dirmod = new DirectoryAttributeModification{Operation = DirectoryAttributeOperation.Add,Name = "uniquemember"};
dirmod.Add(userDn);
request.Modifications.Add(dirmod);
var response = (ModifyResponse)ldapConnection.SendRequest(request); 
//Check response.ResultCode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM