使用哪个身份CodeFluent.Runtime.CodeFluentUser.Current?它使用HttpContext.Current.User.IdentityorThread.CurrentPrincipal.Identity吗?还是它使用回退机制?
2 回答
根据您的回答 AspNet 的意思是:
HttpContext.Current.User当 http 上下文可用时;CodeFluentUserIdentityType.Windows否则
但是,根据文档 AspNet 的意思是:
如果上下文是 ASP.NET,则将使用 HttpContext.Current.User.Identity。否则,将使用 Thread.CurrentPrincipal.Identity。
我认为文档对此是否正确?
CodeFluentUser.Current来电CodeFluentUser.Get(CodeFluentUserIdentityType.CurrentOrWindows)。如果使用CodeFluentContext.User,可以在配置文件中设置身份类型(默认userIdentityType="AspNetOrWindows")
这是每个的文档CodeFluentUserIdentityType:
Windows:WindowsIdentity.GetCurrent()AspNet:HttpContext.Current.User当http上下文可用时;CodeFluentUserIdentityType.Windows否则AspNetOrWindows:HttpContext.Current.User当http上下文可用并且用户通过身份验证时;CodeFluentUserIdentityType.Windows否则Current:Thread.CurrentPrincipal.IdentityCurrentOrWindows:Thread.CurrentPrincipal.Identity认证时;CodeFluentUserIdentityType.Windows否则