protected override void OnAuthentication(AuthenticationContext filterContext) { var firmaSessionFromClaimsIdentity = ClaimsIdentityHelper.FirmaSessionFromClaimsIdentity(HttpContext.GetOwinContext().Authentication, CurrentTenant); // We also need to wedge this in in certain contexts firmaSessionFromClaimsIdentity.SetDatabaseEntities(HttpRequestStorage.DatabaseEntities); // Use this session HttpRequestStorage.FirmaSession = firmaSessionFromClaimsIdentity; // we need to set this so that the save will know who the Person is HttpRequestStorage.DatabaseEntities.Person = firmaSessionFromClaimsIdentity.Person; base.OnAuthentication(filterContext); }
/// <summary> /// Must run before any code attempt to access <see cref="HttpRequestStorage.Person"/> /// </summary> protected override void OnAuthentication(AuthenticationContext filterContext) { HttpRequestStorage.Person = ClaimsIdentityHelper.PersonFromClaimsIdentity(HttpContext.GetOwinContext().Authentication); base.OnAuthentication(filterContext); }