public async Task<ActionResult> Callback(string display, string code)
        {
            var auth = new AuthenticationClient();
            await auth.WebServerAsync(_consumerKey, _consumerSecret, _callbackUrl, code);

            Session["ApiVersion"] = auth.ApiVersion;
            Session["AccessToken"] = auth.AccessToken;
            Session["InstanceUrl"] = auth.InstanceUrl;

            return RedirectToAction("Index", "SalesForce");
        }
        public async Task<HttpResponseMessage> Get(string display, string code)
        {
            var auth = new AuthenticationClient();
            await auth.WebServerAsync(_consumerKey, _consumerSecret, _callbackUrl, code, UserAgent, _tokenRequestEndpointUrl);

            var url = string.Format("/?token={0}&api={1}&instance_url={2}", auth.AccessToken, auth.ApiVersion,
                auth.InstanceUrl);

            var response = new HttpResponseMessage(HttpStatusCode.Redirect);
            response.Headers.Location = new Uri(url, UriKind.Relative);

            return response;
        }
        public override async Task ProcessRequestAsync(HttpContext context)
        {
            AuthenticationClient authenticationClient = new AuthenticationClient();

            // Get the access and refresh tokens from the Salesforce authorization server, and store them
            // on the session object.
            await authenticationClient.WebServerAsync(
                SalesforceService.GetAppSetting("Salesforce:ConsumerKey"),
                SalesforceService.GetAppSetting("Salesforce:ConsumerSecret"),
                SalesforceOAuthRedirectHandler.GetAbsoluteRedirectUri(),
                context.Request.QueryString["code"],
                context.Request.Url.PathAndQuery,
                "common-libraries-dotnet",
                SalesforceService.GetAppSetting("Salesforce:Domain") + "/services/oauth2/token");

            context.Session["AccessToken"] = authenticationClient.AccessToken;
            context.Session["RefreshToken"] = authenticationClient.RefreshToken;
            context.Session["InstanceUrl"] = authenticationClient.InstanceUrl;

            context.Response.Redirect(HttpUtility.ParseQueryString(context.Request.Url.Query).Get("state"), false);
        }