0

I'm using the .NET 7.0 Ready aspnetboilerplate Framework.

While login the user I've added a few Claims. but the concern are custom added Claim auto-removed after some time.

Can anyone know the reason?

enter image description here

jishan siddique
  • 1,848
  • 2
  • 12
  • 23

1 Answers1

1

Do you have cookie authentication set? The problem is most likely an expired cookie. Since the custom claims are not added to the user claims in the database, they are lost on refresh because the claims are not added in the method called. You can add claims in the following ways:

userManager.AddClaim(xxx);

If you don't want to save the claims in the database, there is another method in this link that might help you.

Chen
  • 4,499
  • 1
  • 2
  • 9