public override void OnSetFederatedOrganizationIdentifier(FederationTrust federationTrust, SmtpDomain accountNamespace)
        {
            string    text                 = accountNamespace.ToString();
            string    wkgDomain            = FederatedOrganizationId.AddHybridConfigurationWellKnownSubDomain(text);
            AppIdInfo appIdInfo            = null;
            ManageDelegation2Client client = this.GetManageDelegation(wkgDomain);

            try
            {
                appIdInfo = client.CreateAppId(wkgDomain);
            }
            catch (LiveDomainServicesException ex)
            {
                if (ex.DomainError != null && ex.DomainError.Value == DomainError.ProofOfOwnershipNotValid)
                {
                    throw new DomainProofOwnershipException(Strings.ErrorManageDelegation2ProofDomainOwnership, ex);
                }
                throw new ProvisioningFederatedExchangeException(ex.LocalizedString, ex);
            }
            if (string.IsNullOrEmpty(federationTrust.ApplicationIdentifier))
            {
                if (appIdInfo == null || string.IsNullOrEmpty(appIdInfo.AppId))
                {
                    throw new LiveDomainServicesException(Strings.ErrorLiveDomainServicesUnexpectedResult(Strings.ErrorInvalidApplicationId));
                }
                base.WriteVerbose(Strings.NewFederationTrustSuccessAppId(FederationTrust.PartnerSTSType.LiveId.ToString(), appIdInfo.AppId));
                federationTrust.ApplicationIdentifier = appIdInfo.AppId.Trim();
            }
            base.ReserveDomain(wkgDomain, federationTrust.ApplicationIdentifier, client, Strings.ErrorManageDelegation2ProofDomainOwnership, () => LiveFederationProvision2.GetDomainStateFromDomainInfo(client.GetDomainInfo(federationTrust.ApplicationIdentifier, wkgDomain)));
            using (ManageDelegation2Client manageDelegation = this.GetManageDelegation(text))
            {
                manageDelegation.AddUri(appIdInfo.AppId, text);
            }
        }
        // Token: 0x06000C4D RID: 3149 RVA: 0x00037B60 File Offset: 0x00035D60
        public void DeleteDomain(SmtpDomain domain, Guid tenantId, Namespace ns)
        {
            DeleteDomainRequest request = LocatorServiceClientWriter.ConstructDeleteDomainRequest(domain, tenantId, ns);
            LocatorService      proxy   = this.AcquireServiceProxy();

            GLSLogger.LoggingWrapper <DeleteDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.DeleteDomain(this.requestIdentity, request));
            base.ReleaseServiceProxy(proxy);
        }
        // Token: 0x06000C4B RID: 3147 RVA: 0x00037A34 File Offset: 0x00035C34
        public void SaveDomain(SmtpDomain domain, string domainKey, Guid tenantId, KeyValuePair <DomainProperty, PropertyValue>[] properties)
        {
            SaveDomainRequest request = LocatorServiceClientWriter.ConstructSaveDomainRequest(domain, domainKey, tenantId, properties);
            LocatorService    proxy   = this.AcquireServiceProxy();

            GLSLogger.LoggingWrapper <SaveDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.SaveDomain(this.requestIdentity, request));
            base.ReleaseServiceProxy(proxy);
        }
        public override void OnRemoveFederatedDomain(SmtpDomain smtpDomain, bool force)
        {
            string uri = smtpDomain.ToString();

            using (ManageDelegation1Client manageDelegation = this.GetManageDelegation())
            {
                base.RemoveUri(manageDelegation, uri, force);
            }
        }
        public override void OnAddFederatedDomain(SmtpDomain smtpDomain)
        {
            string domain = smtpDomain.ToString();

            using (ManageDelegation1Client manageDelegation = this.GetManageDelegation())
            {
                base.AddUri(domain, base.ApplicationIdentifier, manageDelegation, Strings.ErrorManageDelegation1ProofDomainOwnership);
            }
        }
 public override void OnRemoveAccountNamespace(SmtpDomain smtpDomain, bool force)
 {
     LiveFederationProvision1.< > c__DisplayClass7 CS$ < > 8__locals1 = new LiveFederationProvision1.< > c__DisplayClass7();
     CS$ < > 8__locals1.< > 4__this = this;
     CS$ < > 8__locals1.domain      = smtpDomain.ToString();
     using (ManageDelegation1Client client = this.GetManageDelegation())
     {
         base.RemoveUri(client, CS$ < > 8__locals1.domain, force);
         base.ReleaseDomain(CS$ < > 8__locals1.domain, base.ApplicationIdentifier, force, client, () => LiveFederationProvision1.GetDomainStateFromDomainInfo(client.GetDomainInfo(CS$ < > 8__locals1.< > 4__this.ApplicationIdentifier, CS$ < > 8__locals1.domain)));
     }
 }
 public override void OnSetFederatedOrganizationIdentifier(FederationTrust federationTrust, SmtpDomain accountNamespace)
 {
     LiveFederationProvision1.< > c__DisplayClass1 CS$ < > 8__locals1 = new LiveFederationProvision1.< > c__DisplayClass1();
     CS$ < > 8__locals1.< > 4__this = this;
     CS$ < > 8__locals1.domain      = accountNamespace.ToString();
     using (ManageDelegation1Client client = this.GetManageDelegation())
     {
         base.ReserveDomain(CS$ < > 8__locals1.domain, base.ApplicationIdentifier, client, Strings.ErrorManageDelegation1ProofDomainOwnership, () => LiveFederationProvision1.GetDomainStateFromDomainInfo(client.GetDomainInfo(CS$ < > 8__locals1.< > 4__this.ApplicationIdentifier, CS$ < > 8__locals1.domain)));
         base.AddUri(CS$ < > 8__locals1.domain, federationTrust.ApplicationIdentifier, client, Strings.ErrorManageDelegation1ProofDomainOwnership);
     }
 }
 public override void OnRemoveAccountNamespace(SmtpDomain smtpDomain, bool force)
 {
     LiveFederationProvision2.< > c__DisplayClass4 CS$ < > 8__locals1 = new LiveFederationProvision2.< > c__DisplayClass4();
     CS$ < > 8__locals1.< > 4__this = this;
     CS$ < > 8__locals1.domain      = smtpDomain.ToString();
     if (FederatedOrganizationId.ContainsHybridConfigurationWellKnownSubDomain(CS$ < > 8__locals1.domain))
     {
         string text = FederatedOrganizationId.RemoveHybridConfigurationWellKnownSubDomain(CS$ < > 8__locals1.domain);
         using (ManageDelegation2Client manageDelegation = this.GetManageDelegation(text))
         {
             base.RemoveUri(manageDelegation, text, force);
         }
     }
     using (ManageDelegation2Client client = this.GetManageDelegation(CS$ < > 8__locals1.domain))
     {
         base.RemoveUri(client, CS$ < > 8__locals1.domain, force);
         base.ReleaseDomain(CS$ < > 8__locals1.domain, base.ApplicationIdentifier, force, client, () => LiveFederationProvision2.GetDomainStateFromDomainInfo(client.GetDomainInfo(CS$ < > 8__locals1.< > 4__this.ApplicationIdentifier, CS$ < > 8__locals1.domain)));
     }
 }
Ejemplo n.º 9
0
        public FindDomainResult FindDomain(SmtpDomain domain, DomainProperty[] domainProperties, TenantProperty[] tenantProperties)
        {
            FindDomainRequest  request  = LocatorServiceClientReader.ConstructFindDomainRequest(domain, domainProperties, tenantProperties, this.glsReadFlag);
            LocatorService     proxy    = this.AcquireServiceProxy();
            FindDomainResponse response = GLSLogger.LoggingWrapper <FindDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindDomain(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(LocatorServiceClientReader.ConstructFindDomainResult(response));
        }
Ejemplo n.º 10
0
        public bool DomainExists(SmtpDomain domain, Namespace[] ns)
        {
            FindDomainRequest  request            = LocatorServiceClientReader.ConstructDomainExistsRequest(domain, ns, this.glsReadFlag);
            LocatorService     proxy              = this.AcquireServiceProxy();
            FindDomainResponse findDomainResponse = GLSLogger.LoggingWrapper <FindDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindDomain(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(findDomainResponse.DomainInfo != null);
        }
        private static bool IsSelectableDomain(Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomain domain, List <string> optionList)
        {
            SmtpDomain smtpDomain = domain.DomainName.SmtpDomain;

            return(domain.DomainType != AcceptedDomainType.ExternalRelay && smtpDomain != null && (optionList == null || optionList.Contains(smtpDomain.ToString(), StringComparer.OrdinalIgnoreCase)));
        }