// Token: 0x06000695 RID: 1685 RVA: 0x00013B64 File Offset: 0x00011D64
        public void UpgradePartialIdentity()
        {
            OWAMiniRecipient owaminiRecipient = null;
            SmtpAddress      smtpAddress      = new SmtpAddress(this.proxyAddress.AddressString);

            ExTraceGlobals.CoreCallTracer.TraceDebug <string>(0L, "OwaMiniRecipientIdentity.UpgradePartialIdentity for smtp: {0}", this.proxyAddress.AddressString);
            IRecipientSession recipientSession = UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, smtpAddress.Domain, null);
            Exception         ex = null;

            try
            {
                owaminiRecipient = recipientSession.FindMiniRecipientByProxyAddress <OWAMiniRecipient>(this.proxyAddress, OWAMiniRecipientSchema.AdditionalProperties);
                if (owaminiRecipient == null)
                {
                    throw new OwaExplicitLogonException(string.Format("The address {0} is an object in AD database but it is not an user", this.proxyAddress), Strings.GetLocalizedString(-1332692688), ex);
                }
            }
            catch (NonUniqueRecipientException ex2)
            {
                ex = ex2;
            }
            if (owaminiRecipient == null || ex != null)
            {
                throw new OwaExplicitLogonException(string.Format("Couldn't find a match for {0}", this.proxyAddress.ToString()), string.Format(Strings.GetLocalizedString(-13616305), this.proxyAddress), ex);
            }
            base.OwaMiniRecipient = owaminiRecipient;
        }
Пример #2
0
        public ADRecipient CreateADRecipientBySid()
        {
            IRecipientSession recipientSession = (this.UserOrganizationId == null) ? UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, this.DomainName, null) : UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, null, this.UserOrganizationId);
            ADRecipient       adrecipient      = recipientSession.FindBySid(this.UserSid);

            if (adrecipient == null)
            {
                throw new OwaADUserNotFoundException(this.SafeGetRenderableName());
            }
            return(adrecipient);
        }
Пример #3
0
        public OWAMiniRecipient CreateOWAMiniRecipientBySid()
        {
            IRecipientSession recipientSession = (this.UserOrganizationId == null) ? UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, this.DomainName, null) : UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, null, this.UserOrganizationId);
            bool flag    = false;
            bool enabled = VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaServer.OwaClientAccessRulesEnabled.Enabled;

            if (enabled)
            {
                ClientAccessRuleCollection collection = ClientAccessRulesCache.Instance.GetCollection(this.UserOrganizationId ?? OrganizationId.ForestWideOrgId);
                flag = (collection.Count > 0);
            }
            OWAMiniRecipient owaminiRecipient = recipientSession.FindMiniRecipientBySid <OWAMiniRecipient>(this.UserSid, flag ? OWAMiniRecipientSchema.AdditionalPropertiesWithClientAccessRules : OWAMiniRecipientSchema.AdditionalProperties);

            if (owaminiRecipient == null)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <SecurityIdentifier>(0L, "OwaIdentity.CreateOWAMiniRecipientBySid: got null OWAMiniRecipient for Sid: {0}", this.UserSid);
                throw new OwaADUserNotFoundException(this.SafeGetRenderableName());
            }
            return(owaminiRecipient);
        }
Пример #4
0
        internal OWAMiniRecipient FixCorruptOWAMiniRecipientCultureEntry()
        {
            if (ExTraceGlobals.CoreTracer.IsTraceEnabled(TraceType.DebugTrace))
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "User {0} has corrupt culture, setting client culture to empty", this.SafeGetRenderableName());
            }
            IRecipientSession recipientSession = (this.UserOrganizationId == null) ? UserContextUtilities.CreateScopedRecipientSession(false, ConsistencyMode.PartiallyConsistent, this.DomainName, null) : UserContextUtilities.CreateScopedRecipientSession(false, ConsistencyMode.PartiallyConsistent, null, this.UserOrganizationId);
            ADUser            aduser           = recipientSession.FindBySid(this.UserSid) as ADUser;

            if (aduser != null)
            {
                aduser.Languages = new MultiValuedProperty <CultureInfo>();
                if (ExTraceGlobals.CoreTracer.IsTraceEnabled(TraceType.DebugTrace))
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "Saving culture for User {0}, setting client culture to empty", this.SafeGetRenderableName());
                }
                recipientSession.Save(aduser);
                return(recipientSession.FindMiniRecipientBySid <OWAMiniRecipient>(this.UserSid, OWAMiniRecipientSchema.AdditionalProperties));
            }
            ExTraceGlobals.CoreTracer.TraceDebug <SecurityIdentifier>(0L, "OwaIdentity.FixCorruptOWAMiniRecipientCultureEntry: got null adUser for Sid: {0}", this.UserSid);
            return(null);
        }
Пример #5
0
        internal static OAuthCredentials GetOAuthCredential(string sipUri)
        {
            ProxyAddress proxyAddress = ProxyAddress.Parse(sipUri);
            string       sipDomain    = OnlineMeetingHelper.GetSipDomain(sipUri);

            if (string.IsNullOrEmpty(sipDomain))
            {
                ExTraceGlobals.OnlineMeetingTracer.TraceError <string>(0L, "[UcwaConfigurationUtilities.GetOAuthCredential] Unable to determine domain from sip uri: {0}", sipUri);
                throw new OwaException(string.Format("Unable to determine domain from sip uri: {0}", sipUri));
            }
            MiniRecipient     miniRecipient    = null;
            IRecipientSession recipientSession = null;

            try
            {
                recipientSession = UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, sipDomain, null);
            }
            catch (OwaADObjectNotFoundException innerException)
            {
                throw new OwaException(string.Format("Couldn't create a scoped recipient session for {0}", sipDomain), innerException);
            }
            try
            {
                miniRecipient = recipientSession.FindByProxyAddress <MiniRecipient>(proxyAddress);
                if (miniRecipient == null)
                {
                    ExTraceGlobals.OnlineMeetingTracer.TraceError <string>(0L, "[UcwaConfigurationUtilities.GetOAuthCredential] IRecipientSession.FindByProxyAddress() unable to find to recipient with address: {0}", sipUri);
                    throw new OwaException(string.Format("Couldn't find a match for {0}", proxyAddress.ToString()));
                }
            }
            catch (NonUniqueRecipientException innerException2)
            {
                ExTraceGlobals.OnlineMeetingTracer.TraceError <string>(0L, "[UcwaConfigurationUtilities.GetOAuthCredential] Couldn't find a unique match for: {0}", sipUri);
                throw new OwaException(string.Format("Couldn't find a unique match for {0}", proxyAddress.ToString()), innerException2);
            }
            return(OAuthCredentials.GetOAuthCredentialsForAppActAsToken(miniRecipient.OrganizationId, miniRecipient, sipDomain));
        }
        // Token: 0x06001058 RID: 4184 RVA: 0x0003EC98 File Offset: 0x0003CE98
        public virtual Uri GetDestinationUri(string user)
        {
            Uri result;

            if (HttpProxyBackEndHelper.TryGetBackEndWebServicesUrlFromSmtp(user, (SmtpAddress address) => UserContextUtilities.CreateScopedRecipientSession(true, ConsistencyMode.FullyConsistent, address.Domain, null), out result))
            {
                return(result);
            }
            return(null);
        }