我在我的Asp.net mvc Web应用程序中使用@ User.Identity.Name。这显示为一旦部署了Azure站点上的本地和[email protected]上的域\用户。而不是使用@ User.Identity.Name,有什么办法可以使它在本地和服务器上是唯一的。由于此冲突,我有许多密码破译区域。User.Identity.Name在发布到Azure之前和之后不同
我将Azure Active Directory身份验证添加到Azure上承载的应用程序。
using (var context = new PrincipalContext(ContextType.Domain))
{
var principal = UserPrincipal.FindByIdentity(context, User.Identity.Name);
var displayName = principal?.DisplayName;
}
这显示名显示在本地和公布一次到Azure它像空“”。在发布之后,在Azure服务器上显示显示名称的最佳方式是什么?