Facebook.OAuthContext.AuthenticateRequest C# (CSharp) Method

AuthenticateRequest() public method

Authenticates current request synchronously. Returns true if the request is authenticated and Session is set; otherwise false.
is null. The operation took longer then .
public AuthenticateRequest ( [ context ) : bool
context [ http context to authenticate.
return bool
        public bool AuthenticateRequest([NotNull] HttpContext context)
        {
            if (context == null)
                throw FacebookApi.Nre("context");

            bool saveSession = true;
            string code = context.Request.QueryString["code"];
            if (!String.IsNullOrEmpty(code))
            {
                Authenticate(code, GetCurrentUrl(context));
            }
            else
            {
                ISessionStorage ss = SessionStorage;
                if (ss != null)
                {
                    _fbSession = ss.Session;
                    if (_fbSession != null
                        && !ss.IsSecure
                        && _fbSession.Signature != GenerateSignature(_fbSession.ToJsonObject()))
                    {
                        _fbSession = null;
                    }

                    saveSession = _fbSession == null;
                }
            }

            if (saveSession)
                SaveSession(context);

            return _fbSession != null;
        }