简体   繁体   English

从一个页面导航到另一页面时,Signalr注销用户

[英]Signalr logging out user when navigating from one page to another

I've got health monitoring set up and I'm receiving the error below. 我已经设置了健康监控,并且收到以下错误。

In the Safari browser I'm receiving the Signalr error below, I have not received this error in other browsers. 在Safari浏览器中,我收到以下Signalr错误,在其他浏览器中未收到此错误。

What is so strange is that when I navigate from one page to the next is that this error will actually log out the user and send them to the log in page and this is after they're logged in. 奇怪的是,当我从一个页面导航到下一个页面时,此错误实际上将注销用户并将他们发送到登录页面,而这正是他们登录后的情况。

Anyone got any ideas as to why this is happening? 任何人都知道为什么会这样吗?

    ** Application Information **
---------------
Application domain: /LM/W3SVC/15/ROOT-1-130329090058437500
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\alumcloud.com\ Machine name: AFBS-WEB1


** Events **
---------------
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 12/30/2013 2:32:24 PM
Event time (UTC): 12/30/2013 8:32:24 PM
Event ID: a243cb6cf5e24be8bfa0d1bec6e77812 Event sequence: 211 Event occurrence: 2 Event detail code: 0

Process information:
    Process ID: 924
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
    Exception type: System.InvalidOperationException
    Exception message: Unrecognized user identity.  The user identity cannot change during an active SignalR connection.

Request information:
    Request URL: http://www.alumcloud.com/signalr/abort?transport=serverSentEvents&connectionToken=xHLBS1B7LGOjUWkVos29QlnBuMwBfTg%2BNQuEDmrhy%2BADr45Yw0iDIHCh1nX8omumVA%2F1eFje774jLVE%2BOId8ab4cJJ3r1hZ8DGlq23yA0WsGk0biYy7JYmnxM2hqu2cw&connectionData=%5B%7B%22name%22%3A%22alumchathub%22%7D%5D
    Request path: /signalr/abort
    User host address: 71.244.XXX.XXX
    User: XXXXXXXXXXXX
    Is authenticated: True
    Authentication Type: Forms
    Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
    Thread ID: 22
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at Microsoft.AspNet.SignalR.PersistentConnection.GetConnectionId(HostContext context, String connectionToken)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
   at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
   at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Since a request was made to /signalr/abort?..., it appears that connection.stop must have been called. 由于已请求/ signalr / abort?...,因此似乎必须已调用connection.stop This can either happen because you called connection.stop directly or because SignalR indirectly called connection.stop for you as the user navigated away from the page using the SignalR connection. 这可能是因为您直接调用connection.stop或由于SignalR在用户使用SignalR连接离开页面导航时间connection.stop为您调用connection.stop。

The exception message ("Unrecognized user identity. The user identity cannot change during an active SignalR connection.") indicates that the user's IIdentity changed between the SignalR connection starting and stopping. 异常消息(“无法识别用户的身份。活性SignalR连接期间用户身份不能改变。”)指示用户的IIdentity所述SignalR连接启动和停止之间改变。

This can happen for multiple reasons, perhaps the most common of which is the ASP.NET forms auth cookie expiring causing the user's identity to become unauthenticated. 发生这种情况可能有多种原因,其中最常见的原因可能是ASP.NET表单身份验证cookie过期,从而导致用户身份未经身份验证。 Other causes could be the user logging off, logging in, or switching users while the SignalR connection is ongoing. 其他原因可能是在SignalR连接进行期间用户注销,登录或切换用户。

SignalR does not allow the user's IIdentity to change during an ongoing connection in order to help prevent CSRF attacks. SignalR不允许用户IIdentity ,以便帮助防止CSRF攻击正在进行的连接期间改变。

The request to /signalr/abort?... is an Ajax request being made by the SignalR client. / signalr / abort?...的请求是SignalR客户端发出的Ajax请求。 The SignalR client doesn't take any action based on the response of the abort request, so I wouldn't expect a failed abort to cause any sort of redirect. SignalR客户端不会根据中止请求的响应采取任何操作,因此我不会期望中止失败会导致任何类型的重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM