How to add additional claims when using Active Directory?

Viewed 20

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?

0 Answers
Related