質問

I want to use Windows Authentication and get User info such as Givenname, Surname, etc. I used UserPrincipal.Current in IIS and I got an exception, but IIS express looks fine.

役に立ちましたか?

解決

I solved by using a Find Method:

var domain = new PrincipalContext(ContextType.Domain);
var currentUser = UserPrincipal.FindByIdentity(domain, User.Identity.Name);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top