【发布时间】:2018-06-25 14:48:09
【问题描述】:
This question 帮助我修复了一个空的 Context.User 值,但修复后,Context.User.Identity.Name 为空。
这是我在 Context.User.Identity 的即时窗口中看到的内容:
{System.Security.Principal.WindowsIdentity}
AccessToken: {Microsoft.Win32.SafeHandles.SafeAccessTokenHandle}
Actor: null
AuthenticationType: ""
BootstrapContext: null
Claims: {System.Security.Principal.WindowsIdentity.<get_Claims>d__95}
CustomSerializationData: null
DeviceClaims: Count = 0
Groups: null
ImpersonationLevel: Anonymous
IsAnonymous: true
IsAuthenticated: false
IsGuest: false
IsSystem: false
Label: null
Name: ""
NameClaimType: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
Owner: null
RoleClaimType: "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid"
Token: {0}
User: null
UserClaims: Count = 0
我怀疑 IsAuthenticated: false 与它有关,但我的身份验证是在 SalesForce 包装器中处理的,而不是通过典型的 FormsAuthentication.SetAuthCookie() 代码 - 我搜索了我的存储库,我们不使用 SetAuthCookie任何地方。根据我在本地主机网页中看到的内容,我已成功通过身份验证。
必须做些什么来填充/访问身份Name?
【问题讨论】:
标签: c# asp.net asp.net-mvc signalr signalr-hub