Authorize with AD LDS User

Topics: Security Application Block
Jun 18, 2010 at 12:06 PM
Hi, I am trying to use security application block with in Enterprise Library 5.0. I create AD LDS service on Windows 2008 and create application store with azman.msc. Then create operations, tasks, roles and assign them to users both that from Active Directory and created on AD LDS. I can Authorize windows users following code. Here is the code.. IAuthorizationProvider iAuthorizationProvider = AuthorizationFactory.GetAuthorizationProvider("MyAzManProvider"); WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool auth = iAuthorizationProvider.Authorize(principal, "BackUp"); It is simple to get a windows authenticated user identity and principal, but how to get identity of an AD LDS user.
Jun 21, 2010 at 2:59 AM

Use the GenericIdentity and GenericPrincipal classes:

IPrincipal principal = new GenericPrincipal(new GenericIdentity("Username"), roles);

summers