Hi all,
I am trying to add new claims to the Identity after the initial login based on certain data that is queriedfrom database. The new claims that I am adding not persisting for subsequent requests.
In asp.net mvc when using OWIN, i did the following.
private static void UpdateAuthenticationResponseGrant(ClaimsIdentity identity) { var context = HttpContext.Current.Request.GetOwinContext(); var authenticationContext = context.Authentication.AuthenticateAsync(DefaultAuthenticationTypes.ApplicationCookie); if (authenticationContext != null) { var authenticationManager = context.Authentication; authenticationManager.AuthenticationResponseGrant = new AuthenticationResponseGrant( identity, new AuthenticationProperties { IsPersistent = true }); } }
Is there is simiar way in ASP.NET Core to persist newly added claims. Appreciate any ideas on this.
Thanks,