Esempio n. 1
0
        public static AnchorMailbox CreateFromCaller(IRequestContext requestContext)
        {
            if (requestContext == null)
            {
                throw new ArgumentNullException("requestContext");
            }
            CommonAccessToken commonAccessToken = requestContext.HttpContext.Items["Item-CommonAccessToken"] as CommonAccessToken;

            if (commonAccessToken != null)
            {
                AnchorMailbox anchorMailbox = AnchorMailboxFactory.TryCreateFromCommonAccessToken(commonAccessToken, requestContext);
                if (anchorMailbox != null)
                {
                    return(anchorMailbox);
                }
            }
            if (requestContext.HttpContext.User == null || requestContext.HttpContext.User.Identity == null)
            {
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "UnauthenticatedRequest-RandomBackEnd");
                return(new AnonymousAnchorMailbox(requestContext));
            }
            WindowsIdentity windowsIdentity = requestContext.HttpContext.User.Identity as WindowsIdentity;

            if (windowsIdentity != null && windowsIdentity.User == null)
            {
                requestContext.Logger.SafeSet(HttpProxyMetadata.RoutingHint, "AnonymousRequest-RandomBackEnd");
                return(new AnonymousAnchorMailbox(requestContext));
            }
            return(AnchorMailboxFactory.CreateFromLogonIdentity(requestContext));
        }
Esempio n. 2
0
        // Token: 0x060000E5 RID: 229 RVA: 0x000055DC File Offset: 0x000037DC
        public static AnchorMailbox CreateFromCaller(IRequestContext requestContext)
        {
            if (requestContext == null)
            {
                throw new ArgumentNullException("requestContext");
            }
            CommonAccessToken commonAccessToken = requestContext.HttpContext.Items["Item-CommonAccessToken"] as CommonAccessToken;

            if (commonAccessToken != null)
            {
                AnchorMailbox anchorMailbox = AnchorMailboxFactory.TryCreateFromCommonAccessToken(commonAccessToken, requestContext);
                if (anchorMailbox != null)
                {
                    return(anchorMailbox);
                }
            }
            if (requestContext.HttpContext.User == null || requestContext.HttpContext.User.Identity == null)
            {
                requestContext.Logger.SafeSet(3, "UnauthenticatedRequest-RandomBackEnd");
                return(new AnonymousAnchorMailbox(requestContext));
            }
            if (HttpProxySettings.IdentityIndependentAuthBehaviorEnabled.Value && requestContext.AuthBehavior.AuthState != AuthState.FrontEndFullAuth)
            {
                AnchorMailbox anchorMailbox2 = requestContext.AuthBehavior.CreateAuthModuleSpecificAnchorMailbox(requestContext);
                if (anchorMailbox2 != null)
                {
                    return(anchorMailbox2);
                }
            }
            WindowsIdentity windowsIdentity = requestContext.HttpContext.User.Identity as WindowsIdentity;

            if (windowsIdentity != null && windowsIdentity.User == null)
            {
                requestContext.Logger.SafeSet(3, "AnonymousRequest-RandomBackEnd");
                return(new AnonymousAnchorMailbox(requestContext));
            }
            return(AnchorMailboxFactory.CreateFromLogonIdentity(requestContext));
        }