I’m playing around with claimbaised authorization in .net 4.5 . This works pretty fine. But I got a hopefully small problem.
I thought that setting the name claim type should result in a identity name
I checked that ident.NameClaimType has the same value as ClaimTypes.Name
Both are http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
I set the new claim. Which i can see is part of the identity claims.
but Identity.Name is still empty.
what am I doing wrong?
ClaimsIdentity ident = (ClaimsIdentity)incomingPrincipal.Identity;
ident.AddClaim(new Claim(ClaimTypes.Name, resourceName));
I had the same issue when my claims identity had not
AuthenticationTypeset. Once I have passed in anAuthenticationTypein theClaimsIdentityconstructor it worked.