简体   繁体   中英

Get Active Directory Details In .NET Core App

I have a .NET Core 2.0 web app running on an internal server through IIS. The server is only accessible if the user has logged on via Active Directory. Is there any way that I can easily retrieve the user's details as I want to use AD for managing the roles

如果您询问如何查找当前用户是谁以及其他属性,请尝试此操作。

public static string currentUserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

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