コード例 #1
0
        // Token: 0x060000E7 RID: 231 RVA: 0x00005928 File Offset: 0x00003B28
        public static bool TryCreateFromMailboxGuid(IRequestContext requestContext, string anchorMailboxAddress, out AnchorMailbox anchorMailbox)
        {
            anchorMailbox = null;
            Guid   mailboxGuid;
            string domain;

            if (RequestHeaderParser.TryGetMailboxGuid(anchorMailboxAddress, ref mailboxGuid, ref domain))
            {
                requestContext.Logger.SafeSet(3, "URL-MailboxGuidWithDomain");
                anchorMailbox = new MailboxGuidAnchorMailbox(mailboxGuid, domain, requestContext);
                return(true);
            }
            return(false);
        }
コード例 #2
0
        // Token: 0x0600049C RID: 1180 RVA: 0x0001973C File Offset: 0x0001793C
        private bool TryMatchByGuidAtDomain(AnonymousPublishingUrl publishingUrl, out AnchorMailbox anchorMailbox)
        {
            anchorMailbox = null;
            string text   = publishingUrl.ParameterSegments[0];
            Guid   empty  = Guid.Empty;
            string empty2 = string.Empty;

            if (RequestHeaderParser.TryGetMailboxGuid(text, ref empty, ref empty2))
            {
                string text2 = string.Format("AnonymousPublishingUrl-MailboxGuid{0}", string.IsNullOrEmpty(empty2) ? string.Empty : "WithDomainAndSmtpFallback");
                base.Logger.Set(3, text2);
                MailboxGuidAnchorMailbox mailboxGuidAnchorMailbox = new MailboxGuidAnchorMailbox(empty, empty2, this);
                if (!string.IsNullOrEmpty(empty2))
                {
                    mailboxGuidAnchorMailbox.FallbackSmtp = text;
                }
                anchorMailbox = mailboxGuidAnchorMailbox;
            }
            return(anchorMailbox != null);
        }
コード例 #3
0
        // Token: 0x060000E8 RID: 232 RVA: 0x00005968 File Offset: 0x00003B68
        public static ArchiveSupportedAnchorMailbox ParseAnchorMailboxFromSmtp(IRequestContext requestContext, string smtpAddress, string source, bool failOnDomainNotFound)
        {
            Guid   empty  = Guid.Empty;
            string empty2 = string.Empty;

            if (RequestHeaderParser.TryGetMailboxGuid(smtpAddress, ref empty, ref empty2))
            {
                string value = string.Format("{0}-MailboxGuid{1}", source, string.IsNullOrEmpty(empty2) ? string.Empty : "WithDomainAndSmtpFallback");
                requestContext.Logger.SafeSet(3, value);
                MailboxGuidAnchorMailbox mailboxGuidAnchorMailbox = new MailboxGuidAnchorMailbox(empty, empty2, requestContext);
                if (!string.IsNullOrEmpty(empty2))
                {
                    mailboxGuidAnchorMailbox.FallbackSmtp = smtpAddress;
                }
                return(mailboxGuidAnchorMailbox);
            }
            requestContext.Logger.SafeSet(3, string.Format("{0}-SMTP", source));
            return(new SmtpAnchorMailbox(smtpAddress, requestContext)
            {
                FailOnDomainNotFound = failOnDomainNotFound
            });
        }
コード例 #4
0
        // Token: 0x06000530 RID: 1328 RVA: 0x0001CD1C File Offset: 0x0001AF1C
        protected override AnchorMailbox ResolveAnchorMailbox()
        {
            string text;
            string text2;

            if (RequestHeaderParser.TryGetPreferServerAffinity(base.HttpContext.Request.Headers, ref text) && text.Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase) && RequestCookieParser.TryGetTargetServerOverride(base.HttpContext.Request.Cookies, ref text2))
            {
                try
                {
                    BackEndServer backendServer = BackEndServer.FromString(text2);
                    base.Logger.Set(3, Constants.BackEndOverrideCookieName);
                    return(new ServerInfoAnchorMailbox(backendServer, this));
                }
                catch (ArgumentException ex)
                {
                    base.Logger.AppendGenericError("Unable to parse TargetServer: {0}", text2);
                    if (ExTraceGlobals.ExceptionTracer.IsTraceEnabled(1))
                    {
                        ExTraceGlobals.ExceptionTracer.TraceDebug <string, ArgumentException>((long)this.GetHashCode(), "[EwsProxyRequestHandler::ResolveAnchorMailbox]: exception hit where target server was '{0}': {1}", text2, ex);
                    }
                }
            }
            return(base.ResolveAnchorMailbox());
        }
コード例 #5
0
        // Token: 0x060000E6 RID: 230 RVA: 0x000056D4 File Offset: 0x000038D4
        public static AnchorMailbox TryCreateFromRoutingHint(IRequestContext requestContext, bool tryTargetServerRoutingHint)
        {
            if (requestContext == null)
            {
                throw new ArgumentNullException("requestContext");
            }
            string fqdn;

            if (tryTargetServerRoutingHint && RequestHeaderParser.TryGetTargetServer(requestContext.HttpContext.Request.Headers, ref fqdn))
            {
                requestContext.Logger.Set(3, "TargetServerHeader");
                return(new ServerInfoAnchorMailbox(fqdn, requestContext));
            }
            string text;

            if (!RequestHeaderParser.TryGetAnchorMailbox(requestContext.HttpContext.Request.Headers, ref text))
            {
                return(null);
            }
            Match match = RegexUtilities.TryMatch(Constants.SidRegex, text);

            if (match != null && match.Success)
            {
                string text2 = RegexUtilities.ParseIdentifier(match, "${sid}");
                if (!string.IsNullOrEmpty(text2))
                {
                    SecurityIdentifier securityIdentifier = null;
                    try
                    {
                        securityIdentifier = new SecurityIdentifier(text2);
                    }
                    catch (ArgumentException ex)
                    {
                        requestContext.Logger.AppendGenericError("Ignored Exception", ex.ToString());
                    }
                    catch (SystemException ex2)
                    {
                        requestContext.Logger.AppendGenericError("Ignored Exception", ex2.ToString());
                    }
                    if (securityIdentifier != null)
                    {
                        requestContext.Logger.SafeSet(3, "AnchorMailboxHeader-SID");
                        return(new SidAnchorMailbox(securityIdentifier, requestContext));
                    }
                }
            }
            Guid   mailboxGuid;
            string text3;

            if (RequestHeaderParser.TryGetMailboxGuid(text, ref mailboxGuid, ref text3))
            {
                string value = string.Format("AnchorMailboxHeader-MailboxGuid{0}", string.IsNullOrEmpty(text3) ? string.Empty : "WithDomain");
                requestContext.Logger.SafeSet(3, value);
                MailboxGuidAnchorMailbox mailboxGuidAnchorMailbox = new MailboxGuidAnchorMailbox(mailboxGuid, text3, requestContext);
                if (!string.IsNullOrEmpty(text3))
                {
                    mailboxGuidAnchorMailbox.FallbackSmtp = text;
                }
                return(mailboxGuidAnchorMailbox);
            }
            if (PuidAnchorMailbox.IsEnabled)
            {
                NetID netID;
                Guid  tenantGuid;
                if (RequestHeaderParser.TryGetNetIdAndTenantGuid(text, ref netID, ref tenantGuid))
                {
                    requestContext.Logger.Set(3, "AnchorMailboxHeader-PuidAndTenantGuid");
                    return(new PuidAnchorMailbox(netID.ToString(), tenantGuid, requestContext, text));
                }
                string text4;
                if (RequestHeaderParser.TryGetNetIdAndDomain(text, ref netID, ref text4))
                {
                    if (string.IsNullOrEmpty(text4))
                    {
                        requestContext.Logger.Set(3, "AnchorMailboxHeader-Puid");
                        return(new PuidAnchorMailbox(netID.ToString(), requestContext, text));
                    }
                    requestContext.Logger.Set(3, "AnchorMailboxHeader-PuidAndDomain");
                    return(new PuidAnchorMailbox(netID.ToString(), text4, requestContext, text));
                }
            }
            if (SmtpAddress.IsValidSmtpAddress(text))
            {
                requestContext.Logger.Set(3, "AnchorMailboxHeader-SMTP");
                return(new SmtpAnchorMailbox(text, requestContext));
            }
            return(null);
        }
コード例 #6
0
        // Token: 0x060000EB RID: 235 RVA: 0x00005DD4 File Offset: 0x00003FD4
        private static AnchorMailbox CreateFromLogonIdentity(IRequestContext requestContext)
        {
            HttpContext httpContext = requestContext.HttpContext;
            IPrincipal  user        = httpContext.User;
            IIdentity   identity    = httpContext.User.Identity;
            string      text;

            HttpContextItemParser.TryGetLiveIdMemberName(httpContext.Items, ref text);
            OAuthIdentity oauthIdentity = identity as OAuthIdentity;

            if (oauthIdentity != null)
            {
                string externalDirectoryObjectId;
                if (RequestHeaderParser.TryGetExternalDirectoryObjectId(httpContext.Request.Headers, ref externalDirectoryObjectId))
                {
                    requestContext.Logger.SafeSet(3, "OAuthIdentity-ExternalDirectoryObjectId");
                    return(new ExternalDirectoryObjectIdAnchorMailbox(externalDirectoryObjectId, oauthIdentity.OrganizationId, requestContext));
                }
                if (oauthIdentity.ActAsUser != null)
                {
                    requestContext.Logger.SafeSet(3, "OAuthIdentity-ActAsUser");
                    return(new OAuthActAsUserAnchorMailbox(oauthIdentity.ActAsUser, requestContext));
                }
                requestContext.Logger.SafeSet(3, "OAuthIdentity-AppOrganization");
                return(new OrganizationAnchorMailbox(oauthIdentity.OrganizationId, requestContext));
            }
            else
            {
                GenericSidIdentity genericSidIdentity = identity as GenericSidIdentity;
                if (genericSidIdentity != null)
                {
                    requestContext.Logger.SafeSet(3, "GenericSidIdentity");
                    return(new SidAnchorMailbox(genericSidIdentity.Sid, requestContext)
                    {
                        PartitionId = genericSidIdentity.PartitionId,
                        SmtpOrLiveId = text
                    });
                }
                DelegatedPrincipal delegatedPrincipal = user as DelegatedPrincipal;
                if (delegatedPrincipal != null && delegatedPrincipal.DelegatedOrganization != null && string.IsNullOrEmpty(text))
                {
                    requestContext.Logger.SafeSet(3, "DelegatedPrincipal-DelegatedOrganization");
                    return(new DomainAnchorMailbox(delegatedPrincipal.DelegatedOrganization, requestContext));
                }
                WindowsIdentity windowsIdentity = identity as WindowsIdentity;
                if (windowsIdentity != null)
                {
                    if (string.IsNullOrEmpty(text))
                    {
                        requestContext.Logger.SafeSet(3, "WindowsIdentity");
                    }
                    else
                    {
                        requestContext.Logger.SafeSet(3, "WindowsIdentity-LiveIdMemberName");
                    }
                    return(new SidAnchorMailbox(windowsIdentity.User, requestContext)
                    {
                        SmtpOrLiveId = text
                    });
                }
                SecurityIdentifier securityIdentifier = null;
                if (IIdentityExtensions.TryGetSecurityIdentifier(identity, ref securityIdentifier) && !securityIdentifier.Equals(AuthCommon.MemberNameNullSid))
                {
                    if (string.IsNullOrEmpty(text))
                    {
                        requestContext.Logger.SafeSet(3, "SID");
                    }
                    else
                    {
                        requestContext.Logger.SafeSet(3, "SID-LiveIdMemberName");
                    }
                    return(new SidAnchorMailbox(securityIdentifier, requestContext)
                    {
                        SmtpOrLiveId = text
                    });
                }
                if (!HttpProxySettings.IdentityIndependentAuthBehaviorEnabled.Value && requestContext.AuthBehavior.AuthState != AuthState.FrontEndFullAuth)
                {
                    AnchorMailbox anchorMailbox = requestContext.AuthBehavior.CreateAuthModuleSpecificAnchorMailbox(requestContext);
                    if (anchorMailbox != null)
                    {
                        return(anchorMailbox);
                    }
                }
                if (!string.IsNullOrEmpty(text) && SmtpAddress.IsValidSmtpAddress(text))
                {
                    requestContext.Logger.SafeSet(3, "Smtp-LiveIdMemberName");
                    return(new SmtpAnchorMailbox(text, requestContext));
                }
                throw new InvalidOperationException(string.Format("Unknown idenity {0} with type {1}.", IIdentityExtensions.GetSafeName(identity, true), identity.ToString()));
            }
        }
コード例 #7
0
 // Token: 0x0600050C RID: 1292 RVA: 0x0001BDA0 File Offset: 0x00019FA0
 protected override AnchorMailbox ResolveAnchorMailbox()
 {
     if (base.State != ProxyRequestHandler.ProxyState.CalculateBackEndSecondRound)
     {
         if (!base.AuthBehavior.IsFullyAuthenticated())
         {
             base.HasPreemptivelyCheckedForRoutingHint = true;
             string liveIdMemberName;
             if (RequestHeaderParser.TryGetAnchorMailboxUpn(base.ClientRequest.Headers, ref liveIdMemberName))
             {
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug <int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: From Header Routing UPN Hint, context {1}.", base.TraceContext);
                 }
                 base.Logger.SafeSet(3, "OwaEcpUpn");
                 return(new LiveIdMemberNameAnchorMailbox(liveIdMemberName, null, this));
             }
             AnchorMailbox anchorMailbox = base.CreateAnchorMailboxFromRoutingHint();
             if (anchorMailbox != null)
             {
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug <int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: From Header Routing Hint, context {1}.", base.TraceContext);
                 }
                 return(anchorMailbox);
             }
         }
         string text = this.TryGetExplicitLogonNode(0);
         bool   flag;
         if (!string.IsNullOrEmpty(text))
         {
             if (SmtpAddress.IsValidSmtpAddress(text))
             {
                 base.IsExplicitSignOn      = true;
                 base.ExplicitSignOnAddress = text;
                 base.Logger.Set(3, "ExplicitSignOn-SMTP");
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug <string, int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: ExplicitSignOn-SMTP. Address {0}, context {1}.", text, base.TraceContext);
                 }
                 return(new SmtpAnchorMailbox(text, this));
             }
             if ((Utilities.IsPartnerHostedOnly || CafeConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).SyndicatedAdmin.Enabled) && text.StartsWith("@"))
             {
                 this.isSyndicatedAdmin = true;
                 text = text.Substring(1);
                 if (SmtpAddress.IsValidDomain(text))
                 {
                     string text2 = this.TryGetExplicitLogonNode(1);
                     if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                     {
                         ExTraceGlobals.VerboseTracer.TraceDebug <string, string, int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: SyndAdmin, domain {0}, SMTP {1}, context {2}.", text, text2, base.TraceContext);
                     }
                     if (!string.IsNullOrEmpty(text2) && SmtpAddress.IsValidSmtpAddress(text2))
                     {
                         base.IsExplicitSignOn      = true;
                         base.ExplicitSignOnAddress = text2;
                         base.Logger.Set(3, "SyndAdmin-SMTP");
                         return(new SmtpAnchorMailbox(text2, this));
                     }
                     base.Logger.Set(3, "SyndAdmin-Domain");
                     return(new DomainAnchorMailbox(text, this));
                 }
             }
         }
         else if (!Utilities.IsPartnerHostedOnly && !GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).MultiTenancy.Enabled)
         {
             string text3 = this.TryGetBackendParameter("TargetServer", out flag);
             if (!string.IsNullOrEmpty(text3))
             {
                 base.Logger.Set(3, "TargetServer" + (flag ? "-UrlQuery" : "-Cookie"));
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug <string, string, int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: On-Premise, TargetServer parameter {0}, from {1}, context {2}.", text3, flag ? "url query" : "cookie", base.TraceContext);
                 }
                 return(new ServerInfoAnchorMailbox(text3, this));
             }
         }
         string text4 = this.TryGetBackendParameter("ExchClientVer", out flag);
         if (!string.IsNullOrEmpty(text4))
         {
             string text5 = Utilities.NormalizeExchClientVer(text4);
             base.Logger.Set(3, "ExchClientVer" + (flag ? "-UrlQuery" : "-Cookie"));
             if (!Utilities.IsPartnerHostedOnly && !GlobalConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).MultiTenancy.Enabled)
             {
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug <string, string, int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: On-Premise, Version parameter {0}, from {1}, context {2}.", text4, flag ? "url query" : "cookie", base.TraceContext);
                 }
                 return(base.GetServerVersionAnchorMailbox(text5));
             }
             string text6 = (string)base.HttpContext.Items["AuthenticatedUserOrganization"];
             if (!string.IsNullOrEmpty(text6))
             {
                 if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
                 {
                     ExTraceGlobals.VerboseTracer.TraceDebug((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: On-Cloud, Version parameter {0}, from {1}, domain {2}, context {3}.", new object[]
                     {
                         text5,
                         flag ? "url query" : "cookie",
                         text6,
                         base.TraceContext
                     });
                 }
                 return(VersionedDomainAnchorMailbox.GetAnchorMailbox(text6, text5, this));
             }
             if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
             {
                 ExTraceGlobals.VerboseTracer.TraceDebug <int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: AuthenticatedUserOrganization is null. Context {0}.", base.TraceContext);
             }
         }
     }
     if (ExTraceGlobals.VerboseTracer.IsTraceEnabled(1))
     {
         ExTraceGlobals.VerboseTracer.TraceDebug <string, int>((long)this.GetHashCode(), "[EcpProxyRequestHandler::ResolveAnchorMailbox]: {0}, context {1}, call base method to do regular anchor mailbox calculation.", (base.State == ProxyRequestHandler.ProxyState.CalculateBackEndSecondRound) ? "Second round" : "Nothing special", base.TraceContext);
     }
     return(base.ResolveAnchorMailbox());
 }
コード例 #8
0
        // Token: 0x060001E0 RID: 480 RVA: 0x00008C98 File Offset: 0x00006E98
        public override AnchorMailbox CreateAuthModuleSpecificAnchorMailbox(IRequestContext requestContext)
        {
            HttpContext          httpContext = requestContext.HttpContext;
            OAuthPreAuthIdentity oauthPreAuthIdentity;

            if (HttpContextUserParser.TryGetOAuthPreAuthIdentity(httpContext.User, ref oauthPreAuthIdentity))
            {
                try
                {
                    string externalDirectoryObjectId;
                    if (!RequestHeaderParser.TryGetExternalDirectoryObjectId(httpContext.Request.Headers, ref externalDirectoryObjectId))
                    {
                        OAuthPreAuthType preAuthType = oauthPreAuthIdentity.PreAuthType;
                        switch (preAuthType)
                        {
                        case 1:
                            requestContext.Logger.SafeSet(3, "PreAuth-Smtp");
                            return(new SmtpAnchorMailbox(oauthPreAuthIdentity.LookupValue, requestContext));

                        case 2:
                            requestContext.Logger.SafeSet(3, "PreAuth-LiveID");
                            return(new LiveIdMemberNameAnchorMailbox(oauthPreAuthIdentity.LookupValue, null, requestContext));

                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                            break;

                        case 8:
                            requestContext.Logger.SafeSet(3, "PreAuth-TenantGuid");
                            return(new DomainAnchorMailbox(oauthPreAuthIdentity.TenantGuid.ToString(), requestContext));

                        case 9:
                            requestContext.Logger.SafeSet(3, "PreAuth-TenantDomain");
                            return(new DomainAnchorMailbox(oauthPreAuthIdentity.TenantDomain, requestContext));

                        case 10:
                            requestContext.Logger.SafeSet(3, "PreAuth-ExternalDirectoryObjectIdTenantGuid");
                            return(new ExternalDirectoryObjectIdAnchorMailbox(oauthPreAuthIdentity.LookupValue, oauthPreAuthIdentity.TenantGuid, requestContext));

                        case 11:
                            requestContext.Logger.SafeSet(3, "PreAuth-ExternalDirectoryObjectIdTenantDomain");
                            return(new ExternalDirectoryObjectIdAnchorMailbox(oauthPreAuthIdentity.LookupValue, oauthPreAuthIdentity.TenantDomain, requestContext));

                        default:
                            switch (preAuthType)
                            {
                            case 99:
                            {
                                string arg = "Unable to parse OAuth token to locate routing key, extended error data=" + oauthPreAuthIdentity.ExtendedErrorInformation;
                                RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericError(requestContext.Logger, "OAuthError", oauthPreAuthIdentity.ExtendedErrorInformation);

                                MSDiagnosticsHeader.SetStandardOAuthDiagnosticsResponse(httpContext, 2000001, string.Format(OAuthErrorsUtil.GetDescription(2007), arg), null, null);
                                requestContext.Logger.SafeSet(3, "PreAuth-AnonymousAnchorMailbox");
                                return(new AnonymousAnchorMailbox(requestContext));
                            }

                            case 100:
                                requestContext.Logger.SafeSet(3, "PreAuth-PuidAndDomain");
                                return(new PuidAnchorMailbox(oauthPreAuthIdentity.LookupValue, oauthPreAuthIdentity.TenantDomain, requestContext, string.Empty));

                            case 101:
                                requestContext.Logger.SafeSet(3, "PreAuth-PuidAndTenantGuid");
                                return(new PuidAnchorMailbox(oauthPreAuthIdentity.LookupValue, oauthPreAuthIdentity.TenantGuid, requestContext, string.Empty));
                            }
                            break;
                        }
                        throw new InvalidOperationException("unknown preauth type");
                    }
                    requestContext.Logger.SafeSet(3, "PreAuth-ExternalDirectoryObjectId-Header");
                    if (!string.IsNullOrEmpty(oauthPreAuthIdentity.TenantDomain))
                    {
                        return(new ExternalDirectoryObjectIdAnchorMailbox(externalDirectoryObjectId, oauthPreAuthIdentity.TenantDomain, requestContext));
                    }
                    if (oauthPreAuthIdentity.TenantGuid != Guid.Empty)
                    {
                        return(new ExternalDirectoryObjectIdAnchorMailbox(externalDirectoryObjectId, oauthPreAuthIdentity.TenantGuid, requestContext));
                    }
                    throw new InvalidOperationException("unknown preauth type");
                }
                finally
                {
                    if (!string.IsNullOrEmpty(oauthPreAuthIdentity.LoggingInfo))
                    {
                        requestContext.Logger.AppendGenericInfo("OAuthInfo", oauthPreAuthIdentity.LoggingInfo);
                    }
                }
            }
            return(null);
        }
コード例 #9
0
        // Token: 0x060005D4 RID: 1492 RVA: 0x0002073C File Offset: 0x0001E93C
        private AnchorMailbox LegacyResolveAnchorMailbox()
        {
            AnchorMailbox anchorMailbox = null;

            if (base.UseRoutingHintForAnchorMailbox)
            {
                string text;
                if (RequestHeaderParser.TryGetExplicitLogonSmtp(base.ClientRequest.Headers, ref text))
                {
                    base.IsExplicitSignOn      = true;
                    base.ExplicitSignOnAddress = text;
                    base.Logger.Set(3, "ExplicitLogon-SMTP-Header");
                    anchorMailbox = new SmtpAnchorMailbox(text, this);
                }
                else
                {
                    text = this.TryGetExplicitLogonNode(0);
                    if (!string.IsNullOrEmpty(text))
                    {
                        if (SmtpAddress.IsValidSmtpAddress(text))
                        {
                            base.IsExplicitSignOn      = true;
                            base.ExplicitSignOnAddress = text;
                            base.Logger.Set(3, "ExplicitLogon-SMTP");
                            anchorMailbox = new SmtpAnchorMailbox(text, this);
                        }
                        else if ((Utilities.IsPartnerHostedOnly || CafeConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).ExplicitDomain.Enabled) && SmtpAddress.IsValidDomain(text))
                        {
                            string domain = text;
                            text = this.TryGetExplicitLogonNode(1);
                            if (text == null)
                            {
                                base.Logger.Set(3, "ExplicitLogon-Domain");
                                anchorMailbox = new DomainAnchorMailbox(domain, this);
                            }
                            else if (SmtpAddress.IsValidSmtpAddress(text))
                            {
                                base.IsExplicitSignOn      = true;
                                base.ExplicitSignOnAddress = text;
                                base.Logger.Set(3, "ExplicitLogon-SMTP");
                                anchorMailbox = new SmtpAnchorMailbox(text, this);
                            }
                        }
                    }
                }
            }
            if (anchorMailbox == null)
            {
                anchorMailbox = base.ResolveAnchorMailbox();
            }
            else
            {
                base.IsAnchorMailboxFromRoutingHint         = true;
                this.originalAnchorMailboxFromExplicitLogon = anchorMailbox;
            }
            UserBasedAnchorMailbox userBasedAnchorMailbox = anchorMailbox as UserBasedAnchorMailbox;

            if (userBasedAnchorMailbox != null)
            {
                userBasedAnchorMailbox.MissingDatabaseHandler = new Func <ADRawEntry, ADObjectId>(this.ResolveMailboxDatabase);
            }
            return(anchorMailbox);
        }
コード例 #10
0
        // Token: 0x060005CA RID: 1482 RVA: 0x000200D0 File Offset: 0x0001E2D0
        protected override AnchorMailbox ResolveAnchorMailbox()
        {
            if (base.AuthBehavior.IsFullyAuthenticated())
            {
                return(this.LegacyResolveAnchorMailbox());
            }
            base.HasPreemptivelyCheckedForRoutingHint = true;
            string        liveIdMemberName;
            AnchorMailbox anchorMailbox;

            if (!RequestHeaderParser.TryGetAnchorMailboxUpn(base.ClientRequest.Headers, ref liveIdMemberName))
            {
                anchorMailbox = base.CreateAnchorMailboxFromRoutingHint();
            }
            else
            {
                base.Logger.SafeSet(3, "OwaEcpUpn");
                anchorMailbox = new LiveIdMemberNameAnchorMailbox(liveIdMemberName, null, this);
            }
            string text;

            RequestHeaderParser.TryGetExplicitLogonSmtp(base.ClientRequest.Headers, ref text);
            if (anchorMailbox == null)
            {
                if (base.UseRoutingHintForAnchorMailbox)
                {
                    if (!string.IsNullOrEmpty(text) && SmtpAddress.IsValidSmtpAddress(text))
                    {
                        base.IsExplicitSignOn      = true;
                        base.ExplicitSignOnAddress = text;
                        base.Logger.Set(3, "ExplicitLogon-SMTP-Header");
                        anchorMailbox = new SmtpAnchorMailbox(text, this);
                    }
                    else
                    {
                        text = this.TryGetExplicitLogonNode(0);
                        if (!string.IsNullOrEmpty(text))
                        {
                            if (SmtpAddress.IsValidSmtpAddress(text))
                            {
                                base.IsExplicitSignOn      = true;
                                base.ExplicitSignOnAddress = text;
                                base.Logger.Set(3, "ExplicitLogon-SMTP");
                                anchorMailbox = new SmtpAnchorMailbox(text, this);
                            }
                            else if ((Utilities.IsPartnerHostedOnly || CafeConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).ExplicitDomain.Enabled) && SmtpAddress.IsValidDomain(text))
                            {
                                text = this.TryGetExplicitLogonNode(1);
                                if (text != null)
                                {
                                    base.IsExplicitSignOn      = true;
                                    base.ExplicitSignOnAddress = text;
                                    base.Logger.Set(3, "ExplicitLogon-SMTP");
                                    anchorMailbox = new SmtpAnchorMailbox(text, this);
                                }
                            }
                        }
                    }
                }
                if (anchorMailbox == null)
                {
                    anchorMailbox = base.ResolveAnchorMailbox();
                }
                else
                {
                    base.IsAnchorMailboxFromRoutingHint         = true;
                    this.originalAnchorMailboxFromExplicitLogon = anchorMailbox;
                }
            }
            else if (!string.IsNullOrWhiteSpace(text))
            {
                if (!string.Equals(anchorMailbox.SourceObject.ToString(), text, StringComparison.InvariantCultureIgnoreCase))
                {
                    RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(base.Logger, "ExplicitLogonMismatch", string.Format("{0}~{1}", anchorMailbox.SourceObject, text));
                }
                this.originalAnchorMailboxFromExplicitLogon = anchorMailbox;
            }
            UserBasedAnchorMailbox userBasedAnchorMailbox = anchorMailbox as UserBasedAnchorMailbox;

            if (userBasedAnchorMailbox != null)
            {
                userBasedAnchorMailbox.MissingDatabaseHandler = new Func <ADRawEntry, ADObjectId>(this.ResolveMailboxDatabase);
            }
            return(anchorMailbox);
        }