Ejemplo n.º 1
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());
 }
Ejemplo n.º 2
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);
        }