1

I'm using Active Directory to handle my auth, but I want to store a few custom session variables myself. When I try the following code, it works... but it doesn't actually save my new identity:

ClaimsIdentity identity = new ClaimsIdentity();
    
identity.AddClaim( new Claim("IsAdminMode", "true"));
    
_httpContextAccessor.HttpContext.User.AddIdentity(identity);

What must I do to make it stick?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Tom Crosman
  • 1,137
  • 1
  • 12
  • 37

0 Answers0