jhi*_*den 6 asp.net asp.net-mvc signalr
我有一个使用Windows身份验证运行signalR 2.1.0的MVC 5网站.因为我正在使用Windows身份验证登录/注销由IIS自动处理.偶尔我收到403错误,说"无法识别的用户身份.用户身份在活动的SignalR连接期间无法更改." 这不会一直发生,我似乎无法找到一个模式,它什么时候做不起作用.有人遇到过这种情况么?
以下是视图中的代码:
<script type="text/javascript">
$(document).ready(function() {
SignalRSetup();
});
function SignalRSetup() {
// Declare a proxy to reference the hub.
var hub = $.connection.tokenRequestHub;
// Create a function that the hub can call to broadcast messages.
hub.client.updateFromService = function(tokenRequestID, message, success) {
var msg = "Token Request ID {0} => {1}".format(tokenRequestID, message);
var notyType = (success) ? 'success' : 'error';
noty({ text: msg, type: notyType, timeout: 2000 });
if (success) {
refreshGrids();
}
};
$.connection.hub.start();//this is where it errors!
}
</script>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.