예제 #1
0
        /// <summary>
        /// Check for existence and then content of our cookie and the information contained therein
        /// </summary>
        /// <param name="context">the HTTP context object of this request</param>
        /// <param name="confidenceIn">Accumulating the confidence values</param>
        /// <returns></returns>
        public SSOConfidence CheckRequest(HttpContext context, SSOConfidence confidenceIn)
        {
            SSOConfidence retval = CheckInputs(context, confidenceIn);

            if (retval.IsBadRequest())
            {
                return(retval);
            }
            int confidenceVal = 0;

            //Check if we have cookies and if we have our cookie
            //??? Will we ever want to check for other cookies?
            if (CookieTools.HasIRCDACookie(context.Request.Cookies))
            {
                /*either High or PartialConfidence */
                HttpCookie target = context.Request.Cookies[CookieTools.HobbesCookieName];
                confidenceVal = calculateCookieConfidence(target);
            }
            else
            {
                confidenceVal = SSOConfidence.NoConfidence;
            }
            retval.SimpleValue = confidenceVal;

            if (confidenceIn != null)
            {
                retval = retval.Accumulate(confidenceIn);
            }
            return(retval);
        }
예제 #2
0
        public SSOConfidence CheckRequest(HttpContext context, SSOConfidence confidenceIn)
        {
            //Inputs
            SSOConfidence retval = CheckInputs(context, confidenceIn);

            if (retval.IsBadRequest())
            {
                return(retval); //Don't bother with further processing, it'll break
            }
            int confidenceVal = 0;

            Id netId = getNetworkID(context);

            if (!String.IsNullOrEmpty(netId.Name))
            {
                if (IsKnownIdLocally(netId))
                {
                    confidenceVal = CalculateNetworkConfidence(netId, context);
                }
            }
            else
            {
                confidenceVal = SSOConfidence.NoConfidence;
            }
            retval.SimpleValue = confidenceVal;

            if (confidenceIn != null)
            {
                retval = retval.Accumulate(confidenceIn);
            }
            return(retval);
        }
예제 #3
0
        /// <summary>
        /// Check request to see if the endpoint is trusted, add to confidence
        /// </summary>
        /// <param name="context">HttpContext object</param>
        /// <param name="confidenceIn">any previous confidence numbers if any or null</param>
        /// <returns></returns>
        public SSOConfidence CheckRequest(HttpContext context, SSOConfidence confidenceIn)
        {
            //Inputs
            SSOConfidence retval = CheckInputs(context, confidenceIn);

            if (retval.IsBadRequest())
            {
                return(retval); //Don't bother with further processing, it'll break
            }
            int confidenceVal = 0;

            if (IsURLanEndPoint(context))
            {
                confidenceVal = SSOConfidence.CompleteConfidence;
                retval.Action = SSOConfidence.ProcessEndpoint;  //ProcessDocument(endpoint);
            }
            else
            {
                confidenceVal = SSOConfidence.NoConfidence;
            }
            retval.SimpleValue = confidenceVal;

            if (confidenceIn != null)
            {
                retval = retval.Accumulate(confidenceIn);
            }
            return(retval);
        }