public static OwaService GetOwaService(ExchangePrincipal principal) { OwaService owaService = null; try { ServiceTopology currentServiceTopology = ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\MultiMailboxSearch\\LinkUtils.cs", "GetOwaService", 197); owaService = (from x in currentServiceTopology.FindAll <OwaService>(principal, ClientAccessType.External, "f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\MultiMailboxSearch\\LinkUtils.cs", "GetOwaService", 200) where x.IsFrontEnd select x).FirstOrDefault <OwaService>(); if (owaService == null) { owaService = (from x in currentServiceTopology.FindAll <OwaService>(principal, ClientAccessType.Internal, "f:\\15.00.1497\\sources\\dev\\infoworker\\src\\common\\MultiMailboxSearch\\LinkUtils.cs", "GetOwaService", 207) where x.IsFrontEnd select x).FirstOrDefault <OwaService>(); } if (owaService == null) { Factory.Current.EventLog.LogEvent(InfoWorkerEventLogConstants.Tuple_DiscoveryFailedToGetOWAService, null, new object[] { principal.MailboxInfo.Location.ServerFqdn }); } } catch (ReadTopologyTimeoutException ex) { Factory.Current.EventLog.LogEvent(InfoWorkerEventLogConstants.Tuple_DiscoveryFailedToGetOWAServiceWithException, null, new object[] { principal.MailboxInfo.Location.ServerFqdn, ex.ToString() }); } return(owaService); }
private static Uri FindRedirectOwaUrlCrossSite(Site targetSite, int expectedMajorVersion, AuthenticationMethod internalAutheticationMethod, AuthenticationMethod externalAuthenticationMethod, BackEndServer backEndServer, out bool isSameAuthMethod, out FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause failureCause) { failureCause = FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause.None; isSameAuthMethod = false; bool isSameAuthExternalService = false; OwaService clientExternalService = null; ServiceTopology currentServiceTopology = ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlCrossSite", 390); string mailboxServerFQDN = backEndServer.Fqdn; new List <OwaService>(); currentServiceTopology.ForEach <OwaService>(delegate(OwaService owaService) { if (ServiceTopology.IsOnSite(owaService, targetSite, "f:\\15.00.1497\\sources\\dev\\cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlCrossSite", 401) && owaService.ClientAccessType == ClientAccessType.External) { int major = OwaServerVersion.CreateFromVersionNumber(owaService.ServerVersionNumber).Major; if (major == expectedMajorVersion) { bool flag = false; if (owaService.AuthenticationMethod == internalAutheticationMethod || ((internalAutheticationMethod & AuthenticationMethod.Fba) != AuthenticationMethod.None && (owaService.AuthenticationMethod & AuthenticationMethod.Fba) != AuthenticationMethod.None)) { flag = true; if (!isSameAuthExternalService) { clientExternalService = null; isSameAuthExternalService = true; } } if (flag || !isSameAuthExternalService) { if (clientExternalService == null) { clientExternalService = owaService; return; } if (ServiceTopology.CasMbxServicesFirst(owaService, clientExternalService, mailboxServerFQDN, "f:\\15.00.1497\\sources\\dev\\cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlCrossSite", 432) < 0) { clientExternalService = owaService; } } } } }, "f:\\15.00.1497\\sources\\dev\\cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlCrossSite", 396); if (clientExternalService != null) { isSameAuthMethod = isSameAuthExternalService; return(clientExternalService.Url); } failureCause = FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause.NoCasFound; return(null); }
private string GetEnterpriseOrE14OwaServiceUrl(IExchangePrincipal exchangePrincipal) { ServiceTopology serviceTopology = this.IsMultitenancyEnabled ? ServiceTopology.GetCurrentLegacyServiceTopology("f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\StoreTasks\\UserOptions\\MailboxCalendarFolder\\SetMailboxCalendarFolder.cs", "GetEnterpriseOrE14OwaServiceUrl", 335) : ServiceTopology.GetCurrentServiceTopology("f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\StoreTasks\\UserOptions\\MailboxCalendarFolder\\SetMailboxCalendarFolder.cs", "GetEnterpriseOrE14OwaServiceUrl", 335); IList <OwaService> list = serviceTopology.FindAll <OwaService>(exchangePrincipal, ClientAccessType.External, SetMailboxCalendarFolder.serviceFilter, "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\StoreTasks\\UserOptions\\MailboxCalendarFolder\\SetMailboxCalendarFolder.cs", "GetEnterpriseOrE14OwaServiceUrl", 339); if (list.Count != 0) { return(list[0].Url.ToString()); } OwaService owaService = serviceTopology.FindAny <OwaService>(ClientAccessType.External, SetMailboxCalendarFolder.serviceFilter, "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\StoreTasks\\UserOptions\\MailboxCalendarFolder\\SetMailboxCalendarFolder.cs", "GetEnterpriseOrE14OwaServiceUrl", 348); if (owaService == null) { throw new NoExternalOwaAvailableException(); } return(owaService.Url.ToString()); }
public static Uri GetOwaBaseLink(Action errorHandler, ExchangePrincipal targetPrincipal, bool supportsIntegratedAuth) { Uri uri = null; if (VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled) { uri = FrontEndLocator.GetFrontEndOwaUrl(targetPrincipal); if (uri == null) { Factory.Current.EventLog.LogEvent(InfoWorkerEventLogConstants.Tuple_DiscoveryFailedToGetOWAUrl, null, new object[] { targetPrincipal.MailboxInfo.Location.ServerFqdn, targetPrincipal.MailboxInfo.OrganizationId.OrganizationalUnit.ObjectGuid, targetPrincipal.MailboxInfo.MailboxGuid }); } else if (!string.IsNullOrEmpty(targetPrincipal.MailboxInfo.PrimarySmtpAddress.ToString())) { SmtpAddress primarySmtpAddress = targetPrincipal.MailboxInfo.PrimarySmtpAddress; if (!string.IsNullOrEmpty(primarySmtpAddress.Domain)) { uri = LinkUtils.AppendRelativePath(uri, primarySmtpAddress.Domain, true); } } } else { OwaService owaService = LinkUtils.GetOwaService(targetPrincipal); if (owaService != null) { uri = owaService.Url; if (supportsIntegratedAuth && owaService.IntegratedFeaturesEnabled) { uri = LinkUtils.AppendRelativePath(uri, "integrated", true); } } else if (errorHandler != null) { errorHandler(); } } return(uri); }
// Token: 0x06000556 RID: 1366 RVA: 0x0001D77C File Offset: 0x0001B97C private static Uri FindRedirectOwaUrlOnSiteForMismatchVersion(Site targetSite, int expectedMajorVersion, AuthenticationMethod internalAutheticationMethod, AuthenticationMethod externalAuthenticationMethod, BackEndServer backEndServer, out bool isSameAuthMethod, out FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause failureCause) { failureCause = FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause.None; isSameAuthMethod = true; bool isSameAuthInternalService = false; bool isSameAuthExternalService = false; OwaService clientInternalService = null; OwaService clientExternalService = null; string mailboxServerFQDN = backEndServer.Fqdn; ServiceTopology currentServiceTopology = ServiceTopology.GetCurrentServiceTopology("d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlOnSiteForMismatchVersion", 578); new List <OwaService>(); currentServiceTopology.ForEach <OwaService>(delegate(OwaService owaService) { if (ServiceTopology.IsOnSite(owaService, targetSite, "d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlOnSiteForMismatchVersion", 587)) { if (owaService.ClientAccessType == 1) { if (OwaServerVersion.CreateFromVersionNumber(owaService.ServerVersionNumber).Major == expectedMajorVersion) { bool flag = false; if (owaService.AuthenticationMethod == internalAutheticationMethod || ((internalAutheticationMethod & 4) != null && (owaService.AuthenticationMethod & 4) != null)) { flag = true; if (!isSameAuthExternalService) { clientExternalService = null; isSameAuthExternalService = true; } } if (flag || !isSameAuthExternalService) { if (clientExternalService == null) { clientExternalService = owaService; return; } if (ServiceTopology.CasMbxServicesFirst(owaService, clientExternalService, mailboxServerFQDN, "d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlOnSiteForMismatchVersion", 618) < 0) { clientExternalService = owaService; return; } } } } else if (owaService.ClientAccessType == null && OwaServerVersion.CreateFromVersionNumber(owaService.ServerVersionNumber).Major == expectedMajorVersion && clientExternalService == null) { bool flag = false; if (owaService.AuthenticationMethod == internalAutheticationMethod || ((internalAutheticationMethod & 4) != null && (owaService.AuthenticationMethod & 4) != null)) { flag = true; if (!isSameAuthInternalService) { clientInternalService = null; isSameAuthInternalService = true; } } if (flag || !isSameAuthInternalService) { if (clientInternalService == null) { clientInternalService = owaService; return; } if (ServiceTopology.CasMbxServicesFirst(owaService, clientInternalService, mailboxServerFQDN, "d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlOnSiteForMismatchVersion", 657) > 0) { clientInternalService = owaService; } } } } }, "d:\\dbs\\sh\\e16df\\0212_214120_0\\cmd\\1g\\sources\\Dev\\Cafe\\src\\HttpProxy\\RequestHandlers\\FbaFormPostProxyRequestHandler.cs", "FindRedirectOwaUrlOnSiteForMismatchVersion", 582); if (clientExternalService != null) { isSameAuthMethod = isSameAuthExternalService; return(clientExternalService.Url); } if (clientInternalService != null) { isSameAuthMethod = isSameAuthInternalService; return(clientInternalService.Url); } failureCause = FbaFormPostProxyRequestHandler.LegacyRedirectFailureCause.NoCasFound; return(null); }