Beispiel #1
0
        public override AnchorMailbox CreateAuthModuleSpecificAnchorMailbox(IRequestContext requestContext)
        {
            HttpCookie    httpCookie = requestContext.HttpContext.Request.Cookies["DefaultAnchorMailbox"];
            AnchorMailbox result;

            if (httpCookie != null && !string.IsNullOrWhiteSpace(httpCookie.Value))
            {
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "DefaultAnchorMailboxCookie");
                result = new LiveIdMemberNameAnchorMailbox(httpCookie.Value, null, requestContext);
            }
            else
            {
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "UnauthenticatedAnonymous");
                result = new AnonymousAnchorMailbox(requestContext);
            }
            return(result);
        }
        // Token: 0x060001D8 RID: 472 RVA: 0x00008C00 File Offset: 0x00006E00
        public override AnchorMailbox CreateAuthModuleSpecificAnchorMailbox(IRequestContext requestContext)
        {
            string        liveIdMemberName;
            AnchorMailbox result;

            if (RequestCookieParser.TryGetDefaultAnchorMailboxCookie(requestContext.HttpContext.Request.Cookies, ref liveIdMemberName))
            {
                requestContext.Logger.SafeSet(3, "DefaultAnchorMailboxCookie");
                result = new LiveIdMemberNameAnchorMailbox(liveIdMemberName, null, requestContext);
            }
            else
            {
                requestContext.Logger.SafeSet(3, "UnauthenticatedAnonymous");
                result = new AnonymousAnchorMailbox(requestContext);
            }
            return(result);
        }
Beispiel #3
0
        public override AnchorMailbox CreateAuthModuleSpecificAnchorMailbox(IRequestContext requestContext)
        {
            HttpCookie    httpCookie = requestContext.HttpContext.Request.Cookies["DefaultAnchorMailbox"];
            AnchorMailbox result;

            if (httpCookie != null && !string.IsNullOrWhiteSpace(httpCookie.Value) && SmtpAddress.IsValidSmtpAddress(httpCookie.Value))
            {
                string organizationContext = base.HttpContext.Items[Constants.WLIDOrganizationContextHeaderName] as string;
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "DefaultAnchorMailboxCookie");
                result = new LiveIdMemberNameAnchorMailbox(httpCookie.Value, organizationContext, requestContext);
            }
            else
            {
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "UnauthenticatedAnonymous");
                result = new AnonymousAnchorMailbox(requestContext);
            }
            return(result);
        }
        // Token: 0x060001B2 RID: 434 RVA: 0x00008840 File Offset: 0x00006A40
        public override AnchorMailbox CreateAuthModuleSpecificAnchorMailbox(IRequestContext requestContext)
        {
            AnchorMailbox result = null;
            string        text;

            if (RequestCookieParser.TryGetDefaultAnchorMailboxCookie(requestContext.HttpContext.Request.Cookies, ref text))
            {
                if (SmtpAddress.IsValidSmtpAddress(text))
                {
                    string organizationContext;
                    HttpContextItemParser.TryGetLiveIdOrganizationContext(requestContext.HttpContext.Items, ref organizationContext);
                    requestContext.Logger.SafeSet(3, "DefaultAnchorMailboxCookie");
                    result = new LiveIdMemberNameAnchorMailbox(text, organizationContext, requestContext);
                }
            }
            else
            {
                requestContext.Logger.SafeSet(3, "UnauthenticatedAnonymous");
                result = new AnonymousAnchorMailbox(requestContext);
            }
            return(result);
        }
Beispiel #5
0
        protected override AnchorMailbox ResolveAnchorMailbox()
        {
            if (base.AuthBehavior.IsFullyAuthenticated())
            {
                return(this.LegacyResolveAnchorMailbox());
            }
            base.HasPreemptivelyCheckedForRoutingHint = true;
            string        text = base.HttpContext.Request.Headers["X-UpnAnchorMailbox"];
            AnchorMailbox anchorMailbox;

            if (string.IsNullOrWhiteSpace(text))
            {
                anchorMailbox = base.CreateAnchorMailboxFromRoutingHint();
            }
            else
            {
                base.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "OwaEcpUpn");
                anchorMailbox = new LiveIdMemberNameAnchorMailbox(text, null, this);
            }
            string text2 = base.ClientRequest.Headers["X-OWA-ExplicitLogonUser"];

            if (anchorMailbox == null)
            {
                if (base.UseRoutingHintForAnchorMailbox)
                {
                    if (!string.IsNullOrEmpty(text2) && SmtpAddress.IsValidSmtpAddress(text2))
                    {
                        base.IsExplicitSignOn      = true;
                        base.ExplicitSignOnAddress = text2;
                        base.Logger.Set(HttpProxyMetadata.RoutingHint, "ExplicitLogon-SMTP-Header");
                        anchorMailbox = new SmtpAnchorMailbox(text2, this);
                    }
                    else
                    {
                        text2 = this.TryGetExplicitLogonNode(ExplicitLogonNode.Second);
                        if (!string.IsNullOrEmpty(text2))
                        {
                            if (SmtpAddress.IsValidSmtpAddress(text2))
                            {
                                base.IsExplicitSignOn      = true;
                                base.ExplicitSignOnAddress = text2;
                                base.Logger.Set(HttpProxyMetadata.RoutingHint, "ExplicitLogon-SMTP");
                                anchorMailbox = new SmtpAnchorMailbox(text2, this);
                            }
                            else if ((Utilities.IsPartnerHostedOnly || VariantConfiguration.InvariantNoFlightingSnapshot.Cafe.ExplicitDomain.Enabled) && SmtpAddress.IsValidDomain(text2))
                            {
                                text2 = this.TryGetExplicitLogonNode(ExplicitLogonNode.Third);
                                if (text2 != null)
                                {
                                    base.IsExplicitSignOn      = true;
                                    base.ExplicitSignOnAddress = text2;
                                    base.Logger.Set(HttpProxyMetadata.RoutingHint, "ExplicitLogon-SMTP");
                                    anchorMailbox = new SmtpAnchorMailbox(text2, this);
                                }
                            }
                        }
                    }
                }
                if (anchorMailbox == null)
                {
                    anchorMailbox = base.ResolveAnchorMailbox();
                }
                else
                {
                    base.IsAnchorMailboxFromRoutingHint         = true;
                    this.originalAnchorMailboxFromExplicitLogon = anchorMailbox;
                }
            }
            else if (!string.IsNullOrWhiteSpace(text2))
            {
                if (!string.Equals(anchorMailbox.SourceObject.ToString(), text2, StringComparison.InvariantCultureIgnoreCase))
                {
                    RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(base.Logger, "ExplicitLogonMismatch", string.Format("{0}~{1}", anchorMailbox.SourceObject, text2));
                }
                this.originalAnchorMailboxFromExplicitLogon = anchorMailbox;
            }
            UserBasedAnchorMailbox userBasedAnchorMailbox = anchorMailbox as UserBasedAnchorMailbox;

            if (userBasedAnchorMailbox != null)
            {
                userBasedAnchorMailbox.MissingDatabaseHandler = new Func <ADRawEntry, ADObjectId>(this.ResolveMailboxDatabase);
            }
            return(anchorMailbox);
        }
        // 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);
        }