【发布时间】:2020-01-18 01:52:56
【问题描述】:
我已将 SignalR 添加到我们现有的 asp.net Web 应用程序中,一切正常。我已将此 Web 应用程序发布到 Azure,现在在调用方法上出现未经授权的错误。
我在 Azure 上启用了 Web 套接字和 ARR 关联。
我没有使用 Authorize 属性。
我是否需要在我的应用程序中添加其他内容来验证 Web 应用程序或用户?
StatusCode:401,ReasonPhrase:“未经授权”,版本:1.1,内容:System.Net.Http.StreamContent,标头: { 日期: 设置 Cookie:ARRAffinity=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;Path=/;HttpOnly;Domain=MyAppx.azurewebsites.net WWW-Authenticate: Bearer realm="MyAppx.azurewebsites.net" authorization_uri="https://login.windows.net/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/oauth2/authorize" resource_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" X-Powered-By: ASP.NET 内容长度:58 内容类型:文本/html }
【问题讨论】:
-
我已将此添加到我的启动方法 GlobalHost.HubPipeline.RequireAuthentication() 并将其添加到我的集线器连接 connection.Credentials = CredentialCache.DefaultCredentials。仍然出现同样的错误。
标签: asp.net-mvc signalr signalr-hub signalr.client