Esempio n. 1
0
        // Token: 0x060003E6 RID: 998 RVA: 0x00016BE8 File Offset: 0x00014DE8
        internal static IRecipientSession GetRecipientSessionFromExternalDirectoryOrganizationId(LatencyTracker latencyTracker, Guid externalOrgId, RequestDetailsLogger logger)
        {
            if (latencyTracker == null)
            {
                throw new ArgumentNullException("latencyTracker");
            }
            if (externalOrgId == Guid.Empty)
            {
                throw new ArgumentNullException("latencyTracker");
            }
            ADSessionSettings sessionSettings = null;

            if (Utilities.IsPartnerHostedOnly || GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).WindowsLiveID.Enabled)
            {
                try
                {
                    sessionSettings = DirectoryHelper.CreateADSessionSettingsWithDiagnostics(() => ADSessionSettings.FromExternalDirectoryOrganizationId(externalOrgId), logger, latencyTracker, false);
                    goto IL_8F;
                }
                catch (CannotResolveExternalDirectoryOrganizationIdException ex)
                {
                    throw new HttpProxyException(HttpStatusCode.NotFound, 3009, ex.Message, ex);
                }
            }
            sessionSettings = ADSessionSettings.FromRootOrgScopeSet();
IL_8F:
            return(DirectoryHelper.CreateSession(sessionSettings));
        }
Esempio n. 2
0
        // Token: 0x060003E3 RID: 995 RVA: 0x00016A28 File Offset: 0x00014C28
        internal static IRecipientSession GetRecipientSessionFromPartition(LatencyTracker latencyTracker, string partitionId, RequestDetailsLogger logger)
        {
            if (latencyTracker == null)
            {
                throw new ArgumentNullException("latencyTracker");
            }
            if (string.IsNullOrEmpty(partitionId))
            {
                throw new ArgumentNullException("partitionId");
            }
            ADSessionSettings adsessionSettings = null;
            PartitionId       partitionIdObject = null;

            if ((Utilities.IsPartnerHostedOnly || GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).MultiTenancy.Enabled) && PartitionId.TryParse(partitionId, ref partitionIdObject))
            {
                try
                {
                    adsessionSettings = DirectoryHelper.CreateADSessionSettingsWithDiagnostics(() => ADSessionSettings.FromAllTenantsPartitionId(partitionIdObject), logger, latencyTracker, true);
                }
                catch (CannotResolvePartitionException ex)
                {
                    if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(2))
                    {
                        ExTraceGlobals.VerboseTracer.TraceWarning <string, CannotResolvePartitionException>(0L, "[DirectoryHelper::GetRecipientSessionFromPartition] Caught CannotResolvePartitionException when resolving partition by partition ID {0}. Exception details: {1}.", partitionId, ex);
                    }
                }
            }
            if (adsessionSettings == null)
            {
                adsessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            }
            return(DirectoryHelper.CreateSession(adsessionSettings));
        }
Esempio n. 3
0
        // Token: 0x060003E5 RID: 997 RVA: 0x00016B70 File Offset: 0x00014D70
        internal static IRecipientSession GetBusinessTenantRecipientSessionFromDomain(string domain, RequestDetailsLogger logger, LatencyTracker latencyTracker)
        {
            if (string.IsNullOrEmpty(domain))
            {
                throw new ArgumentNullException("domain");
            }
            ADSessionSettings sessionSettings;

            if (Utilities.IsPartnerHostedOnly || GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).WindowsLiveID.Enabled)
            {
                sessionSettings = DirectoryHelper.CreateADSessionSettingsWithDiagnostics(() => ADSessionSettings.FromBusinessTenantAcceptedDomain(domain), logger, latencyTracker, false);
            }
            else
            {
                sessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            }
            return(DirectoryHelper.CreateSession(sessionSettings));
        }
Esempio n. 4
0
        // Token: 0x060003E4 RID: 996 RVA: 0x00016AEC File Offset: 0x00014CEC
        internal static IRecipientSession GetRecipientSessionFromSmtpOrLiveId(string smtpOrLiveId, RequestDetailsLogger logger, LatencyTracker latencyTracker, bool ignoreCannotResolveTenantNameException = false)
        {
            if (string.IsNullOrEmpty(smtpOrLiveId))
            {
                throw new ArgumentNullException("smtpOrLiveId");
            }
            ADSessionSettings adsessionSettings = null;

            if ((Utilities.IsPartnerHostedOnly || GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).WindowsLiveID.Enabled) && SmtpAddress.IsValidSmtpAddress(smtpOrLiveId))
            {
                adsessionSettings = DirectoryHelper.CreateADSessionSettingsWithDiagnostics(() => ADSessionSettings.FromTenantRecipientSmtpAddress(new SmtpAddress(smtpOrLiveId), 2), logger, latencyTracker, ignoreCannotResolveTenantNameException);
            }
            if (adsessionSettings == null)
            {
                adsessionSettings = ADSessionSettings.FromRootOrgScopeSet();
            }
            return(DirectoryHelper.CreateSession(adsessionSettings));
        }