Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 在SignalR 2.1.2 Hub中重新使用ASP.NET MVC 5登录用户标识_Asp.net Mvc_Iis_Signalr - Fatal编程技术网

Asp.net mvc 在SignalR 2.1.2 Hub中重新使用ASP.NET MVC 5登录用户标识

Asp.net mvc 在SignalR 2.1.2 Hub中重新使用ASP.NET MVC 5登录用户标识,asp.net-mvc,iis,signalr,Asp.net Mvc,Iis,Signalr,我有一个ASP.NETMVC5应用程序,它使用CookieAthing 已成功使用内部信号器1.x集线器: HttpContext.Current.User.Identity.IsAuthenticated 及 HttpContext.Current.User.Identity.Name 检查用户是否已登录ASP.NET MVC 5应用程序及其姓名 看来信号器里的东西变了,不再工作了 我还尝试: Context.Request.GetHttpContext().User.Identity.IsA

我有一个ASP.NETMVC5应用程序,它使用CookieAthing

已成功使用内部信号器1.x集线器:

HttpContext.Current.User.Identity.IsAuthenticated

HttpContext.Current.User.Identity.Name

检查用户是否已登录ASP.NET MVC 5应用程序及其姓名

看来信号器里的东西变了,不再工作了

我还尝试:

Context.Request.GetHttpContext().User.Identity.IsAuthenticated;
Context.Request.GetHttpContext().User.Identity.Name;

两者都无法获得ASP.NET MVC 5应用程序中的用户标识

获取ASP.NET MVC中设置和使用的用户标识的正确方法是什么

更新: 在IIS 7中-一切正常
在IIS 8.5中-无法访问HttpContext.Current.User.Identity.Name始终为空。

是否立即使用Owin?可能要
GetOwinContext()
Owin for signar。ASP.NET MVC 5,无需更改。