SignInWithClaims drops additional claims after some time #25585
-
I’m using The user is still logged in but the additional claims I added at sign in is gone? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Beta Was this translation helpful? Give feedback.
-
Define "a while". 15-20 minutes perhaps? |
Beta Was this translation helpful? Give feedback.
-
I guess something like this would do the trick? services.Configure<SecurityStampValidatorOptions>(options => {
options.OnRefreshingPrincipal = context => {
var identity = new ClaimsIdentity();
identity.AddClaim(context.CurrentPrincipal.FindFirst(ClaimType.Workspace));
identity.AddClaim(context.CurrentPrincipal.FindFirst(ClaimType.WorkspaceId));
context.NewPrincipal.AddIdentity(identity);
return Task.FromResult(0);
};
}); |
Beta Was this translation helpful? Give feedback.
Define "a while". 15-20 minutes perhaps?