This question helped me fix a null Context.User
value, but after fixing that, Context.User.Identity.Name
is empty.
Here is what I see in the Immediate Window for 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
I am suspicious that IsAuthenticated: false
has something to do with it, but my authentication is handled in a SalesForce wrapper, not via the typical FormsAuthentication.SetAuthCookie()
code - I've searched my repo and we do not use SetAuthCookie
anywhere. I am successfully authenticated based on what I see in my localhost web page.
What must be done to populate / get access to the Identity Name
?