private string NotesForGetBankDetailsByLevel() { var userLang = ClaimsManager.GetClaimValue(ClaimsNames.Language); var notes = LocalizationProvider.GetTranslation(LocalizationProvider.DefaultApplication, userLang, "STRKEY_API_GETBANKDETAILS_NOTES"); return(notes); }
public void CreateReview(string domainKey, string threadType, Guid itemId, string itemTitle, string message, decimal?rating, string status) { var cs = SystemManager.GetCommentsService(); var authorProxy = new AuthorProxy(ClaimsManager.GetCurrentUserId().ToString()); var domainProxy = new GroupProxy("TestDomain", "TestDomainDescription", authorProxy) { Key = domainKey }; cs.CreateGroup(domainProxy); var culture = this.GetCurrentCulture(); var threadProxy = new ThreadProxy(itemTitle, threadType, domainKey, authorProxy) { Key = itemId.ToString() + "_" + culture + "_review", Language = culture }; var thread = cs.CreateThread(threadProxy); DateTime dateCreated = DateTime.UtcNow.AddMinutes(5); var commentProxy = new CommentProxy(message, thread.Key, authorProxy, SystemManager.CurrentHttpContext.Request.UserHostAddress, rating) { Status = status, DateCreated = dateCreated }; cs.CreateComment(commentProxy); }
public ActionResult CreateTorrent(CreateTorrentModel torrentModel) { var user = ClaimsManager.GetCurrentIdentity(); var isUserAuthenticated = this.userService.CheckIfUserIsAuthenticated(user); var isUserModerator = this.userService.CheckIfUserIsModerator(user); if (!isUserAuthenticated || !isUserModerator) { return(this.RedirectToAction("Index")); } var dynamicModuleManager = this.dynamicModuleManagerProvider.DynamicModuleManager; var imageManager = this.imageManagerProvider.ImageManager; var torrentManager = this.torrentManagerProvider.TorrentManager; var torrentItem = dynamicModuleManager.CreateDataItem(torrentType); var currentUserId = SecurityManager.GetCurrentUserId(); this.torrentService.SetTorrentValues(torrentItem, torrentModel, currentUserId); this.torrentService.SetTorrentImage(imageManager, torrentItem); this.torrentService.SetTorrentFile(torrentManager, torrentItem); dynamicModuleManager.Lifecycle.Publish(torrentItem); dynamicModuleManager.SaveChanges(); return(this.RedirectToAction("TorrentDetails", new { urlName = torrentItem.UrlName })); }
public static IEventSchedulerModel LoadModel(Guid widgetId, CultureInfo culture) { var pageManager = PageManager.GetManager(); var objectData = pageManager.GetControls <ObjectData>().SingleOrDefault(p => p.Id == widgetId); if (objectData is PageDraftControl && ClaimsManager.IsBackendUser() == false) { return(null); } IEventSchedulerModel model = null; if (objectData != null) { var mvcProxy = pageManager.LoadControl(objectData, culture) as MvcControllerProxy; if (mvcProxy != null) { var schedullerController = mvcProxy.Controller as EventSchedulerController; if (schedullerController != null) { model = schedullerController.Model; } } } return(model); }
/// <inheritdoc /> public virtual string GetLogoutPageUrl() { string logoutRedirectUrl = this.ExternalLogoutUrl; if (string.IsNullOrEmpty(logoutRedirectUrl)) { if (this.LogoutPageId.HasValue) { logoutRedirectUrl = HyperLinkHelpers.GetFullPageUrl(this.LogoutPageId.Value); } else { logoutRedirectUrl = UrlPath.ResolveAbsoluteUrl(this.currentPageUrl, true); } } if (HttpContext.Current.Request.Url == null) { return(string.Empty); } string fullLogoutUrl = RouteHelper.ResolveUrl(ClaimsManager.GetLogoutUrl(logoutRedirectUrl), UrlResolveOptions.Rooted); // Workaround an issue when the application is hosted under an application path. if (SystemManager.CurrentHttpContext != null && SystemManager.CurrentHttpContext.Request.ApplicationPath != "/") { fullLogoutUrl = fullLogoutUrl.Replace("sts_signout=true&", ""); } return(fullLogoutUrl); }
static void Main(string[] args) { var claims = new List <Claim> { new Claim(100, "00023423", ClaimType.HighRiskClaim), new Claim(100000, "00036453", ClaimType.RegularClaim), new Claim(1, "00090868", ClaimType.RegularClaim), new Claim(1000.5, "00023465", ClaimType.RegularClaim), new Claim(999.5, "00057653", ClaimType.RegularClaim), new Claim(10000000, "00023515", ClaimType.HighRiskClaim) }; var regManager = new RegionalManager(); var distManager = new DistrictManager(); var claimsManager = new ClaimsManager(); var superClaimsManager = new SuperClaimsManager(); claimsManager.SetSuccessor(superClaimsManager); distManager.SetSuccessor(claimsManager); regManager.SetSuccessor(distManager); foreach (var claim in claims) { regManager.HandleClaimRequest(claim); } Console.ReadLine(); }
public async Task <ActionResult> Delete(int documentId) { var claimsManager = new ClaimsManager(HttpContext.User); var targetDoc = await _context .Registrations .Select(_ => _.Documents .Where(doc => doc.DocumentId == documentId) .FirstOrDefault()) .FirstOrDefaultAsync(); if (targetDoc != null) { var docRegistration = await _context .Registrations .Where(_ => _.RegistrationId == targetDoc.RegistrationId) .FirstOrDefaultAsync(); if (docRegistration.InstructorId == claimsManager.GetUserIdClaim()) { _context.Remove(targetDoc); await _context.SaveChangesAsync(); return(NoContent()); } else { return(Unauthorized()); } } ModelState.AddModelError("Errors", "The document could not be found"); return(BadRequest(ModelState)); }
public static void deleteInvoice(string sInvoiceID) { Invoice invoice = null; Claim claim = null; try { int invoiceID = Convert.ToInt32(Core.SecurityManager.DecryptQueryString(sInvoiceID)); using (TransactionScope scope = new TransactionScope()) { invoice = InvoiceManager.Get(invoiceID); if (invoice != null) { invoice.IsVoid = true; InvoiceManager.Save(invoice); // change claim progress status claim = ClaimsManager.GetByID(invoice.ClaimID); if (claim != null) { claim.ProgressStatusID = (int)Globals.ClaimProgressStatus.ClaimInvoiceRejectedRedo; ClaimsManager.Save(claim); scope.Complete(); } } } } catch (Exception ex) { Core.EmailHelper.emailError(ex); } }
/// <summary> /// Executes checks which need to run for every request e.g. notifyLogin if CMS is running the session and extending the session if Gigya is managing it. /// </summary> /// <param name="context"></param> /// <param name="settings"></param> public static void ProcessRequestChecks(HttpContext context, IGigyaModuleSettings settings = null) { var currentNode = SiteMapBase.GetCurrentNode(); if (currentNode != null && currentNode.IsBackend) { return; } // don't need to do anything if the user is editing content in the CMS var identity = ClaimsManager.GetCurrentIdentity(); if (identity.IsBackendUser) { return; } if (context.Items.Contains(_executedProcessRequestKey)) { return; } context.Items[_executedProcessRequestKey] = true; var settingsHelper = new GigyaSettingsHelper(); var logger = LoggerFactory.Instance(); var membershipHelper = new GigyaMembershipHelper(new GigyaApiHelper(settingsHelper, logger), logger); var accountHelper = new GigyaAccountHelper(settingsHelper, logger, membershipHelper, settings); accountHelper.LoginToGigyaIfRequired(); accountHelper.UpdateSessionExpirationCookieIfRequired(context); }
public async Task <ActionResult> CreateDocument(Document newDocument) { var claimsManager = new ClaimsManager(HttpContext.User); if (ModelState.IsValid) { if (claimsManager.GetRoleClaim() == "Instructor") { var targetRegistration = await _context .Registrations .Where(_ => _.RegistrationId == newDocument.RegistrationId && _.InstructorId == claimsManager.GetUserIdClaim()) .FirstOrDefaultAsync(); if (targetRegistration != null) { await _context.AddAsync(newDocument); await _context.SaveChangesAsync(); return(Ok()); } ModelState.AddModelError("Errors", "Registration was not found"); return(BadRequest(ModelState)); } return(Unauthorized()); } return(BadRequest(ModelState)); }
public void AuthenticateUser_IdentityHasClaimTypes() { const string UserName = "******"; const string Password = "******"; SecurityManager.Logout(); SitefinityTestUtilities.ServerOperations.Users().CreateUser(UserName, Password, "*****@*****.**", "test", "test", true, "AuthenticateUser", "IdentityHasClaimTypes", SecurityConstants.AppRoles.FrontendUsers); try { var model = new LoginFormModel(); model.Authenticate(new LoginFormViewModel() { UserName = UserName, Password = Password }, SystemManager.CurrentHttpContext); var currentIdentity = ClaimsManager.GetCurrentIdentity(); Assert.AreEqual(UserName, currentIdentity.Name, "The name of the current identity did not match the user."); Assert.IsNotNull(currentIdentity.NameClaimType, "NameClaimType was not set in the current identity."); Assert.IsNotNull(currentIdentity.RoleClaimType, "RoleClaimType was not set in the current identity."); Assert.AreEqual("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", currentIdentity.NameClaimType, "NameClaimType did not have the expected value."); Assert.AreEqual("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", currentIdentity.RoleClaimType, "RoleClaimType did not have the expected value."); } finally { SecurityManager.Logout(); SitefinityTestUtilities.ServerOperations.Users().DeleteUsers(new[] { UserName }); } }
public async Task <ActionResult <Student> > Get(int id) { var claimsManager = new ClaimsManager(HttpContext.User); var student = await _context .Students .GetStudents() .Where(_ => _.StudentId == id) .FirstOrDefaultAsync(); switch (claimsManager.GetRoleClaim()) { case "Student": if (student.StudentId == claimsManager.GetUserIdClaim()) { return(Ok(student)); } else { return(Unauthorized()); } case "Instructor": return(Ok(student)); case "Admin": return(Ok(student)); } return(Unauthorized()); }
public static bool IsUserLoggedIn(string roleName = null) { bool isUserLoggedIn = false; var currentIdentity = ClaimsManager.GetCurrentIdentity(); if (currentIdentity.IsAuthenticated) { isUserLoggedIn = true; } if (!roleName.IsNullOrEmpty()) { if (isUserLoggedIn) { var currUser = SitefinityHelper.GetUserById(ClaimsManager.GetCurrentIdentity().UserId); if (currUser != null) { isUserLoggedIn = SitefinityHelper.IsUserInRole(currUser, roleName); } else { return(false); } } else { return(false); } } return(isUserLoggedIn); }
/// <summary> /// Updates a user's profile in Sitefinity. /// </summary> public virtual void UpdateProfile(LoginModel model, IGigyaModuleSettings settings, ref LoginResponseModel response) { var userInfoResponse = ValidateRequest(model, settings); if (userInfoResponse == null) { return; } var currentIdentity = ClaimsManager.GetCurrentIdentity(); var currentUsername = currentIdentity.Name; List <MappingField> mappingFields = GetMappingFields(settings); var gigyaModel = GetAccountInfo(model.Id, settings, userInfoResponse, mappingFields); ThrowTestingExceptionIfRequired(settings, gigyaModel); string username = GetCmsUsername(mappingFields, gigyaModel); var success = MapProfileFieldsAndUpdate(currentUsername, username, settings, gigyaModel, mappingFields); if (success) { response.RedirectUrl = settings.RedirectUrl; response.Status = ResponseStatus.Success; if (currentUsername != username) { AuthenticateUser(username, settings, false, gigyaModel, mappingFields); } } }
protected void Page_Init(object sender, EventArgs e) { var currPrincipal = ClaimsManager.GetCurrentPrincipal(); if (!UserManager.GetManager().GetUser(currPrincipal.Identity.Name).IsBackendUser || !currPrincipal.Identity.IsAuthenticated) { Response.Redirect("~/", true); } if (Request.QueryString["prime"] == null || Request.QueryString["reloadevery"] == null || Request.QueryString["timerenabled"] == null) { //If these are not in the querystring redirect over Response.Redirect("~/Sitefinity/Primer/?prime=pages&reloadevery=30000&timerenabled=false"); } if (Request.QueryString["prime"] != null) { var text = String.Empty; foreach (var item in Request.QueryString["prime"].Split(',')) { text += String.Format("'{0}',", item.Trim().ToLower()); } clientStateLiteral.Text = String.Format("{0}", text); } enableTimerLiteral.Text = Request.QueryString["timerenabled"]; intervalLiteral.Text = Request.QueryString["reloadevery"].Replace("ms", "").Replace("MS", ""); this.GetPages(); }
public ActionResult FluentPage() { var guid = Guid.NewGuid(); App.WorkWith().Page().CreateNewStandardPage(SiteInitializer.CurrentFrontendRootNodeId, guid) .Do(p => { p.Title = "The Training Boss Page From Fluent API"; p.Name = "TrainingBossPageFromFluentAPI"; p.Description = "This is a Trainig Page (Fluent) Description"; p.ShowInNavigation = true; p.DateCreated = DateTime.Now; p.LastModified = DateTime.Now; p.Owner = ClaimsManager.GetCurrentUserId(); p.GetPageData().HtmlTitle = "Training Boss Page (Fluent) HTML Title"; p.GetPageData().Description = "Training Boss Page (Fluent) HTML Description"; p.GetPageData().NavigationNode.Title = "Training Boss Page (Fluent) Navigation Title"; }).SaveChanges(); var bag = new Dictionary <string, string>(); bag.Add("ContentType", typeof(PageNode).FullName); WorkflowManager.MessageWorkflow(guid, typeof(PageNode), null, "Publish", false, bag); return(View()); }
public ActionResult CreatePage() { var name = "The Training Boss Page"; var id = Guid.NewGuid(); PageNode parent = pm.GetPageNode(SiteInitializer.CurrentFrontendRootNodeId); PageNode pageNode = pm.CreatePage(parent, id, NodeType.Standard); pageNode.Name = name.ToLower(); pageNode.Title = name; pageNode.Description = name; pageNode.UrlName = Regex.Replace(name.ToLower(), @"[^\w\-\!\$\'\(\)\=\@\d_]+", "-"); pageNode.ShowInNavigation = true; pageNode.DateCreated = DateTime.Now; pageNode.LastModified = DateTime.UtcNow; pageNode.Owner = ClaimsManager.GetCurrentUserId(); PageData pageData = pageNode.GetPageData(); pageData.HtmlTitle = name + " Title for search engines"; pageData.Visible = true; pm.SaveChanges(); var bag = new Dictionary <string, string>(); bag.Add("ContentType", typeof(PageNode).FullName); WorkflowManager.MessageWorkflow(id, typeof(PageNode), null, "Publish", false, bag); return(View()); }
public async Task <ActionResult> Get(int documentId) { var claimsManager = new ClaimsManager(HttpContext.User); // TODO move all this into a query object var targetDocument = await _context .Documents .GetDocumentsWithSubmissions(documentId) .FirstOrDefaultAsync(); if (claimsManager.GetRoleClaim() == "Instructor") { if (targetDocument.Registration.InstructorId == claimsManager.GetUserIdClaim()) { return(Ok(targetDocument.Submissions)); } return(Unauthorized()); } if (claimsManager.GetRoleClaim() == "Student") { var studentSubmission = targetDocument.Submissions.Where(_ => _.StudentEnrollment.StudentId == claimsManager.GetUserIdClaim()); if (studentSubmission != null) { return(Ok(studentSubmission)); } return(Unauthorized()); } return(Unauthorized()); }
public async Task <ActionResult> Unenroll(int enrollmentId) { var claimsManager = new ClaimsManager(HttpContext.User); var targetEnrollment = await _context .StudentEnrollment .GetStudentEnrollment() .Where(_ => _.StudentEnrollmentId == enrollmentId) .FirstOrDefaultAsync(); if (targetEnrollment != null) { if (claimsManager.GetRoleClaim() == "Student") { if (targetEnrollment.StudentId != claimsManager.GetUserIdClaim()) { return(Unauthorized()); } } _context.Remove(targetEnrollment); _context.SaveChanges(); return(NoContent()); } return(NotFound()); }
public IHttpActionResult GetTodos() { var user = new ClaimsManager().GetClaimsIdentity(User.Identity); var model = new AgendamentoConsultaViewModel().CarregarTodosAgendamentos(user.Id, user.TipoCliente, _db); return(Ok(model)); }
// GET: LoginStatus public ActionResult Index() { var viewPath = FileHelper.GetPath("~/Mvc/Views/GigyaLoginStatus/Index.cshtml", ModuleClass.ModuleVirtualPath + "Gigya.Module.Mvc.Views.GigyaLoginStatus.Index.cshtml"); var currentIdentity = ClaimsManager.GetCurrentIdentity(); GigyaLoginStatusViewModel model = GetViewModel(currentIdentity); return(View(viewPath, model)); }
public static User GetCurrentUser(string provider = "") { var identity = ClaimsManager.GetCurrentIdentity(); var user = UserManager.GetManager(provider).GetUser(identity.UserId); return(user); }
/// <summary> /// Determines whether this instance can edit. /// </summary> /// <returns></returns> public virtual bool CanEdit() { var currentIdentity = ClaimsManager.GetCurrentIdentity(); var canEdit = currentIdentity.IsUnrestricted || (!this.UserName.IsNullOrEmpty() && currentIdentity.Name == this.UserName) || this.UserName.IsNullOrEmpty(); return(canEdit); }
/// <summary> /// Logs a user into Gigya by calling NotifyLogin. /// </summary> /// <param name="currentIdentity"></param> public override void LoginToGigyaIfRequired() { if (!_settings.EnableRaas) { _logger.Error("RaaS not enabled."); return; } if (_settings.SessionProvider != GigyaSessionProvider.CMS) { return; } var identity = ClaimsManager.GetCurrentIdentity(); var currentIdentity = new CurrentIdentity { IsAuthenticated = identity.IsAuthenticated, Name = identity.Name, UID = identity.Name }; var cookieName = "glt_" + _settings.ApiKey; if (!currentIdentity.IsAuthenticated || HttpContext.Current.Request.Cookies[cookieName] != null) { // user not logged in return; } // get UID if not the username var uidMapping = _settings.MappedMappingFields.FirstOrDefault(i => i.GigyaFieldName == Constants.GigyaFields.UserId && !string.IsNullOrEmpty(i.CmsFieldName)); if (uidMapping != null && uidMapping.CmsFieldName != Constants.SitefinityFields.UserId) { // get member to find UID field var userManager = UserManager.GetManager(); var currentUser = userManager.GetUser(identity.UserId); if (currentUser == null) { _logger.Error(string.Format("Couldn't find member with username of {0} so couldn't sign them in.", currentIdentity.Name)); return; } var profileManager = UserProfileManager.GetManager(); var profile = profileManager.GetUserProfile <SitefinityProfile>(currentUser); if (profile == null) { _logger.Error(string.Format("Couldn't find profile for member with username of {0} so couldn't sign them in.", currentIdentity.Name)); return; } currentIdentity.UID = profile.GetValue <string>(uidMapping.CmsFieldName); } // user logged into Umbraco but not Gigya so call notifyLogin to sign in LoginToGigya(currentIdentity); }
public void bindData(int policyID) { List <Claim> claims = null; claims = ClaimsManager.GetAll(policyID); gvClaims.DataSource = claims; gvClaims.DataBind(); }
public static User GetCurrentUser() { var userIdentity = ClaimsManager.GetCurrentIdentity(); UserManager manager = UserManager.GetManager(userIdentity.MembershipProvider); var user = manager.GetUser(userIdentity.Name); return(user); }
public async Task <ActionResult> Get(int registrationId) { var claimsManager = new ClaimsManager(HttpContext.User); var targetRegistration = await _context .Registrations .Where(_ => _.RegistrationId == registrationId) .FirstOrDefaultAsync(); if (targetRegistration != null) { var docs = await _context .Registrations .Where(_ => _.RegistrationId == targetRegistration.RegistrationId) .Select(_ => _.Documents .Select(doc => new Document { DocumentId = doc.DocumentId, RegistrationId = doc.RegistrationId, ResourceLink = doc.ResourceLink, DocType = doc.DocType }).ToList()) .FirstOrDefaultAsync(); switch (claimsManager.GetRoleClaim()) { case "Student": var associatedEnrollment = await _context .StudentEnrollment .Where(_ => _.RegistrationId == targetRegistration.RegistrationId && _.StudentId == claimsManager.GetUserIdClaim()) .FirstOrDefaultAsync(); if (associatedEnrollment != null) { return(Ok(docs)); } ModelState.AddModelError("Errors", "You are not enrolled in this course"); return(BadRequest(ModelState)); case "Instructor": if (targetRegistration.InstructorId == claimsManager.GetUserIdClaim()) { return(Ok(docs)); } return(Unauthorized()); } return(Unauthorized()); } else { ModelState.AddModelError("Errors", "That registration could not be found"); return(BadRequest(ModelState)); } }
public List <CRM.Data.Entities.BillToView> getBillToCollection(int claimID) { string claimantName = null; Claim claim = null; Carrier carrier = null; Leads lead = null; List <BillToView> billingCollection = new List <BillToView>(); BillToView billCarrier = null; BillToView billClaimantMailingAddress = null; BillToView billClaimantLossAddress = null; claim = ClaimsManager.Get(claimID); if (claim != null) { // add insurance company if (claim.LeadPolicy.Carrier != null) { carrier = claim.LeadPolicy.Carrier; billCarrier = new BillToView(); billCarrier.billTo = "Carrier"; billCarrier.billingName = carrier.CarrierName; billCarrier.mailingAddress = string.Format("{0} {1}", carrier.AddressLine1 ?? "", carrier.AddressLine2 ?? ""); billCarrier.mailingCity = carrier.CityMaster == null ? "" : carrier.CityMaster.CityName; billCarrier.mailingState = carrier.StateMaster == null ? "" : carrier.StateMaster.StateName; billCarrier.mailingZip = carrier.ZipCode; billingCollection.Add(billCarrier); } // add claimant mailing address lead = claim.LeadPolicy.Leads; claimantName = string.Format("{0} {1}", lead.ClaimantFirstName ?? "", lead.ClaimantLastName ?? ""); billClaimantMailingAddress = new BillToView(); billClaimantMailingAddress.billTo = "Policyholder - Mailing Address"; billClaimantMailingAddress.billingName = claimantName; billClaimantMailingAddress.mailingAddress = lead.MailingAddress ?? ""; billClaimantMailingAddress.mailingCity = lead.MailingCity ?? ""; billClaimantMailingAddress.mailingState = lead.MailingState ?? ""; billClaimantMailingAddress.mailingZip = lead.MailingZip ?? ""; billingCollection.Add(billClaimantMailingAddress); // add claimant loss address billClaimantLossAddress = new BillToView(); billClaimantLossAddress.billTo = "Policyholder - Loss Address"; billClaimantLossAddress.billingName = claimantName; billClaimantLossAddress.mailingAddress = string.Format("{0} {1}", lead.LossAddress ?? "", lead.LossAddress2 ?? ""); billClaimantLossAddress.mailingCity = lead.CityName ?? ""; billClaimantLossAddress.mailingState = lead.StateName ?? ""; billClaimantLossAddress.mailingZip = lead.Zip ?? ""; billingCollection.Add(billClaimantLossAddress); } return(billingCollection); }
private void batchDeleteInvoices() { Claim claim = null; int invoiceID = 0; Invoice invoice = null; try { using (TransactionScope scope = new TransactionScope()) { foreach (GridViewRow row in gvInvoiceQ.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox cbxSelected = row.FindControl("cbxSelected") as CheckBox; if (cbxSelected.Checked) { invoiceID = (int)gvInvoiceQ.DataKeys[row.RowIndex].Values[0]; invoice = InvoiceManager.Get(invoiceID); if (invoice != null) { // make invoice as rejected/void invoice.IsVoid = true; InvoiceManager.Save(invoice); // change claim progress status claim = ClaimsManager.GetByID(invoice.ClaimID); if (claim != null) { claim.ProgressStatusID = (int)Globals.ClaimProgressStatus.ClaimInvoiceRejectedRedo; ClaimsManager.Save(claim); } } } } } // complete transaction scope.Complete(); } lblMessage.Text = "Selected invoices have been rejected."; lblMessage.CssClass = "ok"; } catch (Exception ex) { lblMessage.Text = "Selected invoices were not rejected."; lblMessage.CssClass = "error"; Core.EmailHelper.emailError(ex); } finally { bindData(); } }
protected override CurrentIdentity GetCurrentIdentity() { var currentIdentity = ClaimsManager.GetCurrentIdentity(); return(new CurrentIdentity { IsAuthenticated = currentIdentity.IsAuthenticated, Name = currentIdentity.Name }); }