Last post Aug 17, 2012 10:48 AM by BrockAllen
Aug 17, 2012 02:48 AM|Mayur Rathi|LINK
Hello I ahave a claim aware application and i am using sts to send the claims.
currently i am accessing the claims as
but i want to access a perticular claim and dont want to access it by the position.I want to access it something like thisIdentity.Claims["UserName"].Value.Does anybody know how to do it.please help me to find the proper solution.
Aug 17, 2012 10:48 AM|BrockAllen|LINK
var nameClaimQuery =
from c in Identity.Claims
where c.ClaimType == ClaimsTypes.Name
var nameClaim = nameClaimQuery.FirstOrDefault();
if (nameClaim != null) var name = nameClaim.Value;