// Token: 0x060012C0 RID: 4800 RVA: 0x0004E560 File Offset: 0x0004C760
 private static string SerializeOrganizationId(OrganizationId id)
 {
     return(Convert.ToBase64String(id.GetBytes(PhotoRequestorHeader.SerializedOrganizationIdEncoding)));
 }
        public static IConfigurationSession CreateOrganizationFindingSession(OrganizationId currentOrgId, OrganizationId executingUserOrgId)
        {
            ADObjectId            rootOrgContainerId = ADSystemConfigurationSession.GetRootOrgContainerId(null, null);
            ADSessionSettings     sessionSettings    = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(rootOrgContainerId, currentOrgId, executingUserOrgId, true);
            IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(null, true, ConsistencyMode.PartiallyConsistent, null, sessionSettings, ConfigScopes.TenantSubTree, 643, "CreateOrganizationFindingSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MailboxReplication\\RequestBase\\RequestTaskHelper.cs");

            tenantOrTopologyConfigurationSession.UseConfigNC = false;
            return(tenantOrTopologyConfigurationSession);
        }
        private IRecipientSession ReconstructRecipientSession(PartitionId partitionId, OrganizationId orgId)
        {
            ADSessionSettings sessionSettings = Datacenter.IsMultiTenancyEnabled() ? ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(orgId) : ADSessionSettings.FromAccountPartitionRootOrgScopeSet(partitionId);

            return(DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 307, "ReconstructRecipientSession", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\IsMemberOfProvider\\IsMemberOfResolver.cs"));
        }
Beispiel #4
0
 public override bool TryGetFilter(OrganizationId organizationId, out QueryFilter queryFilter, out LocalizedString errorMessage)
 {
     queryFilter  = ResourceMailboxCapabilityIdentifierEvaluator.filter;
     errorMessage = LocalizedString.Empty;
     return(true);
 }
Beispiel #5
0
 internal static OwaFlightConfigData ReadAggregatedFlightConfigData(UserConfigurationManager.IAggregationContext aggregator, OrganizationId orgId)
 {
     return(UserContextUtilities.ReadAggregatedType <OwaFlightConfigData>(aggregator, "OWA.FlightConfiguration", () => UserContext.ReadFlightConfigDataFromAD(orgId)));
 }
 public ExternalDirectoryObjectIdAnchorMailbox(string externalDirectoryObjectId, OrganizationId organizationId, IRequestContext requestContext) : base(AnchorSource.ExternalDirectoryObjectId, externalDirectoryObjectId, requestContext)
 {
     this.externalDirectoryObjectId = externalDirectoryObjectId;
     this.organizationId            = organizationId;
     base.NotFoundExceptionCreator  = delegate()
     {
         string message = string.Format("Cannot find mailbox by ExternalDirectoryObjectId={0} in organizationId={1}.", this.externalDirectoryObjectId, this.organizationId);
         return(new HttpProxyException(HttpStatusCode.NotFound, HttpProxySubErrorCode.MailboxExternalDirectoryObjectIdNotFound, message));
     };
 }
Beispiel #7
0
 public static MailboxSession OpenStore(OrganizationId organizationId, string displayName, string mailboxFqdn, string mailboxServerDN, Guid mailboxGuid, Guid mdbGuid, MultiValuedProperty <CultureInfo> senderLocales, MultiValuedProperty <Guid> aggregatedMailboxGuids)
 {
     return(StoreProvider.StoreProviderInstance.OpenStore(organizationId, displayName, mailboxFqdn, mailboxServerDN, mailboxGuid, mdbGuid, senderLocales, aggregatedMailboxGuids));
 }
 internal ComplianceReader(OrganizationId organizationId)
 {
     this.messageClassificationReader = new MessageClassificationReader(organizationId);
     this.rmsTemplateReader           = new RmsTemplateReader(organizationId);
 }
Beispiel #9
0
        internal static PolicyConfiguration GetPolicyConfiguration(ADObjectId owaMailboxPolicyId, OrganizationId organizationId)
        {
            PolicyConfiguration policyConfiguration = null;

            if (owaMailboxPolicyId != null)
            {
                policyConfiguration = OwaMailboxPolicyCache.Instance.Get(new OrgIdADObjectWrapper(owaMailboxPolicyId, organizationId));
            }
            if (policyConfiguration == null)
            {
                ADObjectId adobjectId = OwaMailboxPolicyIdCacheByOrganization.Instance.Get(organizationId);
                if (adobjectId != null)
                {
                    policyConfiguration = OwaMailboxPolicyCache.Instance.Get(new OrgIdADObjectWrapper(adobjectId, organizationId));
                }
            }
            return(policyConfiguration);
        }
 // Token: 0x0600091A RID: 2330 RVA: 0x000280E1 File Offset: 0x000262E1
 internal void SetOrganizationId(OrganizationId organizationId)
 {
     base.InternalSetOrganizationId(organizationId);
 }
        // Token: 0x0600124B RID: 4683 RVA: 0x00069084 File Offset: 0x00067284
        public AssistantTaskContext InitializeOABGeneration(AssistantTaskContext assistantTaskContext)
        {
            OABGeneratorTaskContext oabgeneratorTaskContext = assistantTaskContext as OABGeneratorTaskContext;
            AssistantStep           oabstep = new AssistantStep(this.BeginProcessingOAB);

            OABLogger.LogRecord(TraceType.FunctionTrace, "OABGeneratorAssistant.InitialStep: start", new object[0]);
            OABGeneratorMailboxData oabgeneratorMailboxData = (OABGeneratorMailboxData)oabgeneratorTaskContext.Args.MailboxData;

            try
            {
                OrganizationId organizationId = oabgeneratorMailboxData.OrganizationId;
                if (organizationId == null)
                {
                    throw new ArgumentException("unable to determine organization Id");
                }
                oabgeneratorTaskContext.PerOrgAdSystemConfigSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(false, ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(organizationId), 502, "InitializeOABGeneration", "f:\\15.00.1497\\sources\\dev\\MailboxAssistants\\src\\assistants\\OABGenerator\\OABGeneratorAssistant.cs");
                if (oabgeneratorMailboxData.OfflineAddressBook == Guid.Empty)
                {
                    OABLogger.LogRecord(TraceType.InfoTrace, "OABGenerator invoked for scheduled generation of OABs for Org '{0}' on DatabaseGuid={1}", new object[]
                    {
                        organizationId,
                        oabgeneratorTaskContext.Args.MailboxData.DatabaseGuid
                    });
                    oabgeneratorTaskContext.OABsToGenerate = this.GetOABsFromAD(oabgeneratorTaskContext, Guid.Empty);
                }
                else
                {
                    OABLogger.LogRecord(TraceType.InfoTrace, "OABGenerator invoked {0} for on-demand generation of OAB {1} for Org {2} DatabaseGuid={3}, MailboxGuid={4}", new object[]
                    {
                        oabgeneratorMailboxData.JobDescription,
                        oabgeneratorMailboxData.OfflineAddressBook,
                        organizationId,
                        oabgeneratorTaskContext.Args.MailboxData.DatabaseGuid,
                        oabgeneratorMailboxData.MailboxGuid
                    });
                    oabgeneratorTaskContext.OABsToGenerate = this.GetOABsFromAD(oabgeneratorTaskContext, oabgeneratorMailboxData.OfflineAddressBook);
                    if (oabgeneratorTaskContext.OABsToGenerate == null || oabgeneratorTaskContext.OABsToGenerate.Count != 1)
                    {
                        OABLogger.LogEvent(InfoWorkerEventLogConstants.Tuple_CannotFindOAB, new object[]
                        {
                            oabgeneratorMailboxData.OfflineAddressBook
                        });
                    }
                }
                if (oabgeneratorTaskContext.OABsToGenerate == null || oabgeneratorTaskContext.OABsToGenerate.Count == 0)
                {
                    OABLogger.LogRecord(TraceType.InfoTrace, "InvokeInternal. No OABs found to generate for DatabaseGuid={0}, MailboxGuid={1}", new object[]
                    {
                        oabgeneratorMailboxData.DatabaseGuid,
                        oabgeneratorMailboxData.MailboxGuid.ToString(),
                        oabgeneratorMailboxData.Guid
                    });
                    if (oabgeneratorTaskContext.Cleanup != null)
                    {
                        oabgeneratorTaskContext.Cleanup(oabgeneratorTaskContext);
                    }
                    return(null);
                }
                OABLogger.LogRecord(TraceType.InfoTrace, "Found {0} OAB(s) to generate", new object[]
                {
                    oabgeneratorTaskContext.OABsToGenerate.Count
                });
                oabgeneratorTaskContext.CurrentOAB = oabgeneratorTaskContext.OABsToGenerate.Dequeue();
            }
            finally
            {
                OABLogger.LogRecord(TraceType.FunctionTrace, "OABGeneratorAssistant.InitialStep: finish", new object[0]);
                oabgeneratorTaskContext.OABStep = oabstep;
            }
            return(OABGeneratorTaskContext.FromOABGeneratorTaskContext(oabgeneratorTaskContext));
        }
Beispiel #12
0
        internal static IEnumerable <DataClassificationPresentationObject> QueryDataClassification(IEnumerable <string> queriedIdentities, OrganizationId organizationId, IConfigurationSession openedDataSession = null, IClassificationDefinitionsDataReader dataReader = null, IClassificationDefinitionsDiagnosticsReporter diagnosticsReporter = null)
        {
            ArgumentValidator.ThrowIfNull("queriedIdentities", queriedIdentities);
            if (object.ReferenceEquals(null, organizationId))
            {
                throw new ArgumentNullException("organizationId");
            }
            List <string> list = new List <string>();
            Dictionary <string, DataClassificationPresentationObject> queriedNameDictionary     = new Dictionary <string, DataClassificationPresentationObject>(StringComparer.Ordinal);
            Dictionary <string, DataClassificationPresentationObject> queriedGuidDictionary     = new Dictionary <string, DataClassificationPresentationObject>(ClassificationDefinitionConstants.RuleIdComparer);
            Dictionary <string, DataClassificationPresentationObject> allQueryResultsDictionary = new Dictionary <string, DataClassificationPresentationObject>(ClassificationDefinitionConstants.RuleIdComparer);

            foreach (string text in queriedIdentities)
            {
                if (!string.IsNullOrEmpty(text))
                {
                    list.Add(text);
                    Guid guid;
                    if (GuidHelper.TryParseGuid(text, out guid))
                    {
                        queriedGuidDictionary.Add(text, null);
                    }
                    else
                    {
                        queriedNameDictionary.Add(text, null);
                    }
                }
            }
            if (!list.Any <string>())
            {
                return(Enumerable.Empty <DataClassificationPresentationObject>());
            }
            DlpUtils.DataClassificationQueryContext dataClassificationQueryContext = new DlpUtils.DataClassificationQueryContext(organizationId, diagnosticsReporter ?? ClassificationDefinitionsDiagnosticsReporter.Instance);
            bool flag  = queriedNameDictionary.Any <KeyValuePair <string, DataClassificationPresentationObject> >();
            bool flag2 = queriedGuidDictionary.Any <KeyValuePair <string, DataClassificationPresentationObject> >();

            foreach (Tuple <TransportRule, XDocument> tuple in DlpUtils.AggregateOobAndCustomClassificationDefinitions(organizationId, openedDataSession, null, null, dataReader, dataClassificationQueryContext.CurrentDiagnosticsReporter))
            {
                dataClassificationQueryContext.CurrentRuleCollectionTransportRuleObject = tuple.Item1;
                dataClassificationQueryContext.CurrentRuleCollectionXDoc = tuple.Item2;
                IEnumerable <QueryMatchResult> nameMatchResultsFromCurrentRulePack = Enumerable.Empty <QueryMatchResult>();
                if (!flag || DlpUtils.GetNameQueryMatchResult(dataClassificationQueryContext, queriedNameDictionary.Keys, out nameMatchResultsFromCurrentRulePack))
                {
                    IEnumerable <QueryMatchResult> idMatchResultsFromCurrentRulePack = Enumerable.Empty <QueryMatchResult>();
                    if (!flag2 || DlpUtils.GetIdQueryMatchResult(dataClassificationQueryContext, queriedGuidDictionary.Keys, out idMatchResultsFromCurrentRulePack))
                    {
                        DlpUtils.PopulateMatchResults(dataClassificationQueryContext, queriedNameDictionary, nameMatchResultsFromCurrentRulePack, queriedGuidDictionary, idMatchResultsFromCurrentRulePack, allQueryResultsDictionary);
                    }
                }
            }
            return((from presentationObject in list.Select(delegate(string queriedIdentity)
            {
                DataClassificationPresentationObject result;
                if (queriedNameDictionary.TryGetValue(queriedIdentity, out result))
                {
                    return result;
                }
                if (!queriedGuidDictionary.TryGetValue(queriedIdentity, out result))
                {
                    return null;
                }
                return result;
            })
                    where presentationObject != null
                    select presentationObject).ToList <DataClassificationPresentationObject>());
        }
Beispiel #13
0
        internal static Dictionary <string, HashSet <string> > GetAllClassificationIdentifiers(OrganizationId organizationId, IConfigurationSession openedDataSession = null, Func <TransportRule, bool> inclusiveFilter = null, QueryFilter additionalFilter = null, IClassificationDefinitionsDataReader dataReader = null, IClassificationDefinitionsDiagnosticsReporter classificationDefinitionsDiagnosticsReporter = null)
        {
            IClassificationDefinitionsDiagnosticsReporter classificationDefinitionsDiagnosticsReporter2 = classificationDefinitionsDiagnosticsReporter ?? ClassificationDefinitionsDiagnosticsReporter.Instance;
            Dictionary <string, HashSet <string> >        dictionary = new Dictionary <string, HashSet <string> >(ClassificationDefinitionConstants.RuleCollectionIdComparer);

            foreach (Tuple <TransportRule, XDocument> tuple in DlpUtils.AggregateOobAndCustomClassificationDefinitions(organizationId, openedDataSession, inclusiveFilter, additionalFilter, dataReader, classificationDefinitionsDiagnosticsReporter2))
            {
                TransportRule item  = tuple.Item1;
                XDocument     item2 = tuple.Item2;
                ExAssert.RetailAssert(item2 != null, "XDocument instance returned from AggregateOobAndCustomClassificationDefinitions should never be null!");
                string           rulePackId;
                HashSet <string> value;
                try
                {
                    rulePackId = XmlProcessingUtils.GetRulePackId(item2);
                    value      = new HashSet <string>(XmlProcessingUtils.GetAllRuleIds(item2), ClassificationDefinitionConstants.RuleIdComparer);
                }
                catch (XmlException ex)
                {
                    ClassificationDefinitionsDiagnosticsReporter.Instance.WriteCorruptRulePackageDiagnosticsInformation(0, organizationId, item.DistinguishedName, new AggregateException(new Exception[]
                    {
                        ex
                    }).Flatten());
                    continue;
                }
                ExAssert.RetailAssert(!dictionary.ContainsKey(rulePackId), "Duplicate classification rule collection ID '{0}' under tenant's organization '{1}' is a should never ever happen case", new object[]
                {
                    rulePackId,
                    organizationId.ToString()
                });
                dictionary.Add(rulePackId, value);
            }
            return(dictionary);
        }
Beispiel #14
0
 internal DataClassificationQueryContext(OrganizationId currentOrganizationIdQueryContext, IClassificationDefinitionsDiagnosticsReporter diagnosticsReporterToUse)
 {
     this.CurrentOrganizationId      = currentOrganizationIdQueryContext;
     this.CurrentDiagnosticsReporter = diagnosticsReporterToUse;
 }
Beispiel #15
0
        internal static IEnumerable <Tuple <TransportRule, XDocument> > AggregateOobAndCustomClassificationDefinitions(OrganizationId organizationId, IConfigurationSession openedDataSession = null, Func <TransportRule, bool> inclusiveFilter = null, QueryFilter additionalFilter = null, IClassificationDefinitionsDataReader dataReader = null, IClassificationDefinitionsDiagnosticsReporter classificationDefinitionsDiagnosticsReporter = null)
        {
            IClassificationDefinitionsDataReader          dataReaderToUse = dataReader ?? ClassificationDefinitionsDataReader.DefaultInstance;
            IClassificationDefinitionsDiagnosticsReporter classificationDefinitionsDiagnosticsReporterToUse = classificationDefinitionsDiagnosticsReporter ?? ClassificationDefinitionsDiagnosticsReporter.Instance;

            foreach (TransportRule transportRule in dataReaderToUse.GetAllClassificationRuleCollection(organizationId, openedDataSession, additionalFilter))
            {
                if (inclusiveFilter != null)
                {
                    if (!inclusiveFilter(transportRule))
                    {
                        continue;
                    }
                }
                XDocument rulePackXDoc;
                try
                {
                    rulePackXDoc = ClassificationDefinitionUtils.GetRuleCollectionDocumentFromTransportRule(transportRule);
                }
                catch (InvalidOperationException)
                {
                    classificationDefinitionsDiagnosticsReporterToUse.WriteInvalidObjectInformation(0, organizationId, transportRule.DistinguishedName);
                    continue;
                }
                catch (ArgumentException underlyingException)
                {
                    classificationDefinitionsDiagnosticsReporterToUse.WriteCorruptRulePackageDiagnosticsInformation(0, organizationId, transportRule.DistinguishedName, underlyingException);
                    continue;
                }
                catch (AggregateException ex)
                {
                    classificationDefinitionsDiagnosticsReporterToUse.WriteCorruptRulePackageDiagnosticsInformation(0, organizationId, transportRule.DistinguishedName, ex.Flatten());
                    continue;
                }
                catch (XmlException ex2)
                {
                    classificationDefinitionsDiagnosticsReporterToUse.WriteCorruptRulePackageDiagnosticsInformation(0, organizationId, transportRule.DistinguishedName, new AggregateException(new Exception[]
                    {
                        ex2
                    }).Flatten());
                    continue;
                }
                yield return(new Tuple <TransportRule, XDocument>(transportRule, rulePackXDoc));
            }
            yield break;
        }
        private static bool HandleClassificationEngineValidatorException(Exception exception, OrganizationId currentOrganizationId)
        {
            COMException ex = exception as COMException;

            if (ex == null)
            {
                return(false);
            }
            int errorCode = ex.ErrorCode;

            if (errorCode == -2147220981)
            {
                throw new ClassificationRuleCollectionValidationException(Strings.ClassificationRuleCollectionEngineValidationFailure, ex);
            }
            if (errorCode == -2147220978)
            {
                List <string> list  = (List <string>)ex.Data[ClassificationEngineValidator.BadRegexesKey];
                string        names = string.Join(Strings.ClassificationRuleCollectionOffendingListSeparator, list);
                throw ClassificationDefinitionUtils.PopulateExceptionSource <ClassificationRuleCollectionRegexValidationException, List <string> >(new ClassificationRuleCollectionRegexValidationException(Strings.ClassificationRuleCollectionRegexValidationFailure(names), ex), list);
            }
            int errorCode2 = ex.ErrorCode;

            ClassificationDefinitionsDiagnosticsReporter.Instance.WriteClassificationEngineUnexpectedFailureInValidation(0, currentOrganizationId, errorCode2);
            throw new ClassificationRuleCollectionInternalValidationException(errorCode2, ex);
        }
Beispiel #17
0
 internal UserPhotoRecipientQuery(ClientContext clientContext, ADObjectId baseDN, OrganizationId organizationId, DateTime queryPrepareDeadline, ITracer upstreamTracer) : base(clientContext, baseDN, organizationId, queryPrepareDeadline, UserPhotoRecipientQuery.RecipientProperties)
 {
     this.tracer = ExTraceGlobals.UserPhotosTracer.Compose(upstreamTracer);
 }
 // Token: 0x060013B3 RID: 5043 RVA: 0x00045D98 File Offset: 0x00043F98
 internal override ScopeSet CalculateScopeSetForExchangeCmdlet(string exchangeCmdletName, IList <string> parameters, OrganizationId organizationId, Task.ErrorLoggerDelegate writeError)
 {
     if (this.IsMaximumAgeLimitExceeded(ExpirationLimit.RunspaceRefresh))
     {
         base.LoadRoleCmdletInfo();
         this.SetMaxAgeLimit(ExpirationLimit.RunspaceRefresh);
         base.RefreshProvisioningBroker();
     }
     return(base.CalculateScopeSetForExchangeCmdlet(exchangeCmdletName, parameters, organizationId, writeError));
 }
Beispiel #19
0
        public static IRecipientSession GetRecipientSessionScopedToOrganization(OrganizationId orgId, bool readOnly)
        {
            ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(ADSystemConfigurationSession.GetRootOrgContainerIdForLocalForest(), orgId, null, false);

            return(DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(readOnly, ConsistencyMode.IgnoreInvalid, sessionSettings, 224, "GetRecipientSessionScopedToOrganization", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\um\\Utils.cs"));
        }
        private static OwaClientSecurityContextIdentity InternalCreateFromClientSecurityContextIdentity(ClientSecurityContextIdentity cscIdentity, string logonName, OrganizationId userOrganizationId = null)
        {
            SidBasedIdentity sidBasedIdentity = cscIdentity as SidBasedIdentity;

            if (sidBasedIdentity != null)
            {
                OwaClientSecurityContextIdentity.PrePopulateUserGroupSids(sidBasedIdentity);
            }
            OwaClientSecurityContextIdentity result;

            try
            {
                using (ClientSecurityContext clientSecurityContext = cscIdentity.CreateClientSecurityContext())
                {
                    result = new OwaClientSecurityContextIdentity(clientSecurityContext, logonName, cscIdentity.AuthenticationType, userOrganizationId);
                }
            }
            catch (AuthzException ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string, string, AuthzException>(0L, "OwaClientSecurityContextIdentity.CreateFromClientSecurityContextIdentity for ClientSecurityContextIdentity.Name={0} ClientSecurityContextIdentity.AuthenticationType={1} failed with exception: {2}", cscIdentity.Name, cscIdentity.AuthenticationType, ex);
                if (ex.InnerException is Win32Exception)
                {
                    throw new OwaIdentityException("There was a problem creating the Client Security Context.", ex);
                }
                throw;
            }
            return(result);
        }
Beispiel #21
0
 public static PublicFolderSession OpenStore(OrganizationId organizationId, Guid mailboxGuid)
 {
     return(StoreProvider.StoreProviderInstance.OpenStore(organizationId, mailboxGuid));
 }
 private OwaClientSecurityContextIdentity(ClientSecurityContext clientSecurityContext, string logonName, string authenticationType, OrganizationId userOrganizationId)
 {
     if (clientSecurityContext == null)
     {
         throw new ArgumentNullException("clientSecurityContext");
     }
     if (string.IsNullOrEmpty(logonName))
     {
         throw new ArgumentNullException("logonName", "logonName cannot be null or empty.");
     }
     if (userOrganizationId == null && !OwaIdentity.IsLogonNameFullyQualified(logonName))
     {
         throw new ArgumentException("logonName", string.Format(CultureInfo.InvariantCulture, "'{0}' is not a valid logon name.", new object[]
         {
             logonName
         }));
     }
     if (string.IsNullOrEmpty(authenticationType))
     {
         throw new ArgumentNullException("authenticationType", "authenticationType cannot be null or empty.");
     }
     this.logonName          = logonName;
     this.authenticationType = authenticationType;
     base.UserOrganizationId = userOrganizationId;
     if (!SyncUtilities.IsDatacenterMode())
     {
         this.clientSecurityContext = clientSecurityContext;
         OWAMiniRecipient owaminiRecipient = base.GetOWAMiniRecipient();
         if (owaminiRecipient != null && owaminiRecipient.MasterAccountSid != null)
         {
             try
             {
                 this.clientSecurityContext = OwaClientSecurityContextIdentity.TokenMunger.MungeToken(clientSecurityContext, OrganizationId.ForestWideOrgId);
                 return;
             }
             catch (TokenMungingException ex)
             {
                 ExTraceGlobals.CoreCallTracer.TraceError(0L, "OwaClientSecurityContextIdentity.TokenMunger.MungeToken for LogonName='{0}', AuthenticationType='{1}', UserOrgId='{2}' failed with exception: {3}", new object[]
                 {
                     this.logonName,
                     this.authenticationType,
                     base.UserOrganizationId,
                     ex.Message
                 });
             }
         }
     }
     this.clientSecurityContext = clientSecurityContext.Clone();
 }
Beispiel #23
0
 // Token: 0x060003E7 RID: 999 RVA: 0x00016C9C File Offset: 0x00014E9C
 internal static IRecipientSession GetRecipientSessionFromOrganizationId(LatencyTracker latencyTracker, OrganizationId organizationId, RequestDetailsLogger logger)
 {
     if (latencyTracker == null)
     {
         throw new ArgumentNullException("latencyTracker");
     }
     if (organizationId == null)
     {
         organizationId = OrganizationId.ForestWideOrgId;
     }
     Func <ADSessionSettings> < > 9__1;
     return(DirectoryHelper.CreateSession(DirectoryHelper.ExecuteFunctionAndUpdateMovingAveragePerformanceCounter <ADSessionSettings>(PerfCounters.HttpProxyCountersInstance.MovingAverageTenantLookupLatency, delegate
     {
         LatencyTracker latencyTracker2 = latencyTracker;
         Func <ADSessionSettings> glsCall;
         if ((glsCall = < > 9__1) == null)
         {
             glsCall = (< > 9__1 = (() => ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(organizationId)));
         }
         return DirectoryHelper.InvokeGls <ADSessionSettings>(latencyTracker2, glsCall, logger);
     })));
 // Token: 0x06000039 RID: 57 RVA: 0x00002E5C File Offset: 0x0000105C
 internal UserToken(AuthenticationType authenticationType, DelegatedPrincipal delegatedPrincipal, string windowsLiveId, string userName, SecurityIdentifier userSid, PartitionId partitionId, OrganizationId organization, string managedOrganization, bool appPasswordUsed, CommonAccessToken commonAccessToken)
 {
     ExTraceGlobals.UserTokenTracer.TraceDebug(0L, "Version:{0}; AuthenticationType:{1}; DelegatedPrincipal:{2} WindowsLiveId:{3}; UserName:{4}; UserSid:{5}; PartitionId:{6}; Organization:{7}; ManagedOrg:{8};AppPasswordUsed:{9}; CAT:{10}", new object[]
     {
         0,
         authenticationType,
         delegatedPrincipal,
         windowsLiveId,
         userName,
         userSid,
         partitionId,
         organization,
         managedOrganization,
         appPasswordUsed,
         commonAccessToken
     });
     this.Version             = 0;
     this.AuthenticationType  = authenticationType;
     this.DelegatedPrincipal  = delegatedPrincipal;
     this.WindowsLiveId       = windowsLiveId;
     this.UserName            = userName;
     this.UserSid             = userSid;
     this.PartitionId         = partitionId;
     this.Organization        = organization;
     this.ManagedOrganization = managedOrganization;
     this.AppPasswordUsed     = appPasswordUsed;
     this.CommonAccessToken   = commonAccessToken;
 }
 internal MsgToRpMsgConverter(MessageItem envelopeMessage, Participant conversationOwner, OrganizationId orgId, RmsTemplate restriction, OutboundConversionOptions options)
 {
     MsgToRpMsgConverter < > 4__this = this;
     using (DisposeGuard disposeGuard = this.Guard())
     {
         this.options   = options;
         this.orgId     = orgId;
         this.charset   = ConvertUtils.GetItemMimeCharset(envelopeMessage.CoreItem.PropertyBag);
         this.messageId = envelopeMessage.InternetMessageId;
         MsgToRpMsgConverter.RpMsgConversionAddressCache rpMsgConversionAddressCache = new MsgToRpMsgConverter.RpMsgConversionAddressCache(this.options);
         rpMsgConversionAddressCache.CopyRecipientsFromItem(envelopeMessage);
         rpMsgConversionAddressCache.Sender = conversationOwner;
         if (envelopeMessage.From != null)
         {
             rpMsgConversionAddressCache.From = envelopeMessage.From;
         }
         rpMsgConversionAddressCache.Resolve();
         string senderAddress = ItemToMimeConverter.TryGetParticipantSmtpAddress(rpMsgConversionAddressCache.Sender ?? conversationOwner);
         if (string.IsNullOrEmpty(senderAddress))
         {
             ExTraceGlobals.StorageTracer.TraceError <string>(0L, "Message sender must have SMTP address to protect the message: {0}", conversationOwner.DisplayName);
             throw new CorruptDataException(ServerStrings.CannotProtectMessageForNonSmtpSender);
         }
         List <string> recipientAddresses = new List <string>(envelopeMessage.Recipients.Count);
         for (int i = 0; i < envelopeMessage.Recipients.Count; i++)
         {
             string text = ItemToMimeConverter.TryGetParticipantSmtpAddress(rpMsgConversionAddressCache.GetRecipient(i) ?? envelopeMessage.Recipients[i].Participant);
             if (!string.IsNullOrEmpty(text))
             {
                 recipientAddresses.Add(text);
             }
             else
             {
                 ExTraceGlobals.StorageTracer.TraceError <string>(0L, "Message recipient must have SMTP address to be included in the IRM message license: {0}", envelopeMessage.Recipients[i].Participant.DisplayName);
             }
         }
         string fromAddress = string.Empty;
         if (rpMsgConversionAddressCache.From != null)
         {
             fromAddress = ItemToMimeConverter.TryGetParticipantSmtpAddress(rpMsgConversionAddressCache.From);
             if (string.IsNullOrEmpty(fromAddress))
             {
                 ExTraceGlobals.StorageTracer.TraceError <string>(0L, "Message from participant must have SMTP address to be included in the IRM message license: {0}", rpMsgConversionAddressCache.From.DisplayName);
             }
         }
         this.InitTenantLicenses();
         MsgToRpMsgConverter.CallRM(delegate
         {
 // Token: 0x06000058 RID: 88 RVA: 0x00003368 File Offset: 0x00001568
 private void Deserialize(Stream stream)
 {
     using (BinaryReader binaryReader = new BinaryReader(stream))
     {
         this.ReadAndValidateFieldType(binaryReader, 'V', Strings.MissingVersion);
         this.Version = this.BinaryRead <ushort>(new Func <ushort>(binaryReader.ReadUInt16), Strings.MissingVersion);
         this.ReadAndValidateFieldType(binaryReader, 'A', Strings.MissingAuthenticationType);
         string             value = this.BinaryRead <string>(new Func <string>(binaryReader.ReadString), Strings.MissingAuthenticationType);
         AuthenticationType authenticationType;
         if (!Enum.TryParse <AuthenticationType>(value, out authenticationType))
         {
             ExTraceGlobals.UserTokenTracer.TraceError <AuthenticationType>(0L, "Invalid authentication type {0}", authenticationType);
             throw new UserTokenException(Strings.InvalidDelegatedPrincipal(value));
         }
         this.AuthenticationType = authenticationType;
         this.ReadAndValidateFieldType(binaryReader, 'D', Strings.MissingDelegatedPrincipal);
         string             text = this.ReadNullableString(binaryReader, Strings.MissingDelegatedPrincipal);
         DelegatedPrincipal delegatedPrincipal = null;
         if (text != null && !DelegatedPrincipal.TryParseDelegatedString(text, out delegatedPrincipal))
         {
             ExTraceGlobals.UserTokenTracer.TraceError <string>(0L, "Invalid delegated principal {0}", text);
             throw new UserTokenException(Strings.InvalidDelegatedPrincipal(text));
         }
         this.DelegatedPrincipal = delegatedPrincipal;
         this.ReadAndValidateFieldType(binaryReader, 'L', Strings.MissingWindowsLiveId);
         this.WindowsLiveId = this.ReadNullableString(binaryReader, Strings.MissingWindowsLiveId);
         this.ReadAndValidateFieldType(binaryReader, 'N', Strings.MissingUserName);
         this.UserName = this.ReadNullableString(binaryReader, Strings.MissingUserName);
         this.ReadAndValidateFieldType(binaryReader, 'U', Strings.MissingUserSid);
         string text2 = this.ReadNullableString(binaryReader, Strings.MissingUserSid);
         if (text2 != null)
         {
             try
             {
                 this.UserSid = new SecurityIdentifier(text2);
             }
             catch (ArgumentException innerException)
             {
                 ExTraceGlobals.UserTokenTracer.TraceError <string>(0L, "Invalid user sid {0}", text2);
                 throw new UserTokenException(Strings.InvalidUserSid(text2), innerException);
             }
         }
         this.ReadAndValidateFieldType(binaryReader, 'P', Strings.MissingPartitionId);
         string      text3       = this.ReadNullableString(binaryReader, Strings.MissingPartitionId);
         PartitionId partitionId = null;
         if (text3 != null && !PartitionId.TryParse(text3, out partitionId))
         {
             ExTraceGlobals.UserTokenTracer.TraceError <string>(0L, "Invalid partition id {0}", text3);
             throw new UserTokenException(Strings.InvalidPartitionId(text3));
         }
         this.PartitionId = partitionId;
         this.ReadAndValidateFieldType(binaryReader, 'O', Strings.MissingOrganization);
         string text4 = this.ReadNullableString(binaryReader, Strings.MissingOrganization);
         if (text4 != null)
         {
             byte[] bytes;
             try
             {
                 bytes = Convert.FromBase64String(text4);
             }
             catch (FormatException innerException2)
             {
                 ExTraceGlobals.UserTokenTracer.TraceError <string>(0L, "Invalid organization id {0}", text4);
                 throw new UserTokenException(Strings.InvalidOrganization(text4), innerException2);
             }
             OrganizationId organization;
             if (!OrganizationId.TryCreateFromBytes(bytes, Encoding.UTF8, out organization))
             {
                 ExTraceGlobals.UserTokenTracer.TraceError <string>(0L, "Invalid organization id {0}", text4);
                 throw new UserTokenException(Strings.InvalidOrganization(text4));
             }
             this.Organization = organization;
         }
         this.ReadAndValidateFieldType(binaryReader, 'M', Strings.MissingManagedOrganization);
         this.ManagedOrganization = this.ReadNullableString(binaryReader, Strings.MissingManagedOrganization);
         this.ReadAndValidateFieldType(binaryReader, 'W', Strings.MissingAppPasswordUsed);
         this.AppPasswordUsed = this.BinaryRead <bool>(new Func <bool>(binaryReader.ReadBoolean), Strings.MissingAppPasswordUsed);
         int num = (int)(binaryReader.BaseStream.Length - binaryReader.BaseStream.Position);
         if (num > 0)
         {
             byte[] array = binaryReader.ReadBytes(num);
             array = this.Decompress(array);
             this.CommonAccessToken = CommonAccessToken.Deserialize(Encoding.UTF8.GetString(array));
         }
         else
         {
             this.CommonAccessToken = null;
         }
     }
 }
 public static bool CheckUserOrgIdIsTenant(OrganizationId userOrgId)
 {
     return(!userOrgId.Equals(OrganizationId.ForestWideOrgId));
 }
Beispiel #28
0
 private IConfigurationSession Initialize(OrganizationId organizationId, bool throwExceptions)
 {
     this.organizationId = organizationId;
     return(this.CreateSession(throwExceptions));
 }
Beispiel #29
0
 public TranslatedChanges WithOrganization(OrganizationId value)
 {
     return(new TranslatedChanges(Reason, Operator, value, _changes, _mapToRoadNodeId, _mapToRoadSegmentId));
 }
Beispiel #30
0
 internal ConversationAggregationLogger(Guid mailboxGuid, OrganizationId organizationId) : base(mailboxGuid, organizationId, ConversationAggregationLogger.Instance.Value)
 {
 }
Beispiel #31
0
 public IEnumerable<Action> ForOrganization(OrganizationId organization, IEnumerable<ActionType> filter = null, ISince since = null, Paging paging = null)
 {
     return _restClient.Request<List<Action>>(new ActionsForOrganizationRequest(organization, since, paging, filter));
 }
Beispiel #32
0
 public Task<IEnumerable<Action>> ForOrganization(OrganizationId organization, ISince since = null, Paging paging = null)
 {
     return _restClient.RequestListAsync<Action>(new ActionsForOrganizationRequest(organization, since, paging));
 }