Embed UserPrincipal in WindowsIdentity

I have created a WCF service to authorize my applications through AzMan services. I tried to use UserPrincipal for WindowsIdentity in different ways. My script:

Web MVC calling a WCF service to pass a Windows ID variable to the AzMan class.

var u1 = new WindowsIdentity("MyDomain\\userName")

      

throws

The specified name is not a well-formed account name.

var u2 = new WindowsIndetity("userName@MyDomain.com")

      

throws

The username or password you entered is incorrect.

I can get UserPrincipal from " userName@MyDomain.com " calling

var pc = new PrincipalContext(ContextType.Domain);
UserPrincipal user = UserPrincipal.FindByIdentity(pc, IdentityType.UserPrincipalName, upn);

      

In a nutshell, I'm stuck because the company I work for uses AzMan everywhere.

+3


source to share





All Articles