Search code examples
c#asp.netclaims

How to get other users ClaimsPrinciple in ASP.NET?


I want to create a page with all users' claims. However, I don't quite understand whether user's ClaimsPrinciple is being stored somewhere after logout. If yes, then how can I access it?


Solution

  • If you want to access the claims just before calling sign-out you can read the property of type IEnumerable<Claim>:

    HttpContext.User.Calims
    

    Once the sign-out is done, you will no longer have that information available.