Facebook.OAuthContext.BeginAuthenticate C# (CSharp) Method

BeginAuthenticate() public method

Begins to authenticates with a code given synchronously. See for more information.
either or is null.
public BeginAuthenticate ( [ code, [ redirectUri, AsyncCallback cb, object state ) : IAsyncResult
code [ a verification string passed in the query string argument code when redirecting to
redirectUri [ a url which was passed to as next url argument. It should not contain query part.
cb AsyncCallback a callback to call upon operation is completed.
state object the user state to pass to the callback.
return IAsyncResult
        public IAsyncResult BeginAuthenticate([NotNull] string code, [NotNull] string redirectUri, AsyncCallback cb, object state)
        {
            if (String.IsNullOrEmpty(redirectUri))
                throw new ArgumentNullException("redirectUri");
            if (String.IsNullOrEmpty(code))
                throw FacebookApi.Nre("code");

            return NewApiClient().BeginRequest(
                c_oauthTokenUrl,
                HttpVerb.Post,
                new Dictionary<string, string>
                {
                    {"client_id", _appId},
                    {"client_secret", _appSecret},
                    {"redirect_uri", redirectUri},
                    {"code", code}
                },
                cb, state);
        }