4

I've created a WCF service to authorize my apps through AzMan services. I've been trying to cast an UserPrincipal to WindowsIdentity by many ways. My scenario is:

A Web MVC calling a WCF service which needs to pass a windows identity variable to an AzMan class.

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

throws

The name provided is not a properly formed account name.

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

throws

The user name or password is incorrect.

I'm able to get an 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 stucked because the company where I work uses AzMan everywhere.

gandarez
  • 2,609
  • 4
  • 34
  • 47

0 Answers0