Desktop application login with facebook
<p>I have an application that implies a login (using a server request) and then open the "real app" (after the access confirmations). I want to make the job easier for te users, using facebook and google+ login.</p>

<p>For the app registering purposes I've only have to send the email (if the facebook or the google+ was used). I'm trying to use the Facebook C# SDK API. </p>

<p>But I'm having this error</p>

<blockquote>
  <p>Additional information: (OAuthException - #1) The request is invalid because the app is configured as a desktop app</p>
</blockquote>

<p>This is strange but it happens here:</p>

<pre><code>public string GetAccessToken(FacebookOAuthResult oauthResult)
    {
        var client = new FacebookClient();
        dynamic result = client.Get("oauth/access_token",
        new
        {
            client_id = appId,
            client_secret = secret,
            redirect_uri = redirectUri,
            code = oauthResult.Code
        });
        return result.access_token;
    }`
</code></pre>

<p><strong>The rest of the code</strong></p>

<pre><code>protected Uri GetLoginUrl()
        {
            FacebookClient a = new FacebookClient();
            var fbLoginUri = a.GetLoginUrl(new
            {
                client_id = appId,
                redirect_uri = "https://www.facebook.com/connect/login_success.html",
                response_type = "code",
                display = "popup",
                scope = "email"
            });
            return fbLoginUri;
        }
private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            try
            {
                var loginUrl = GetLoginUrl();
                MyWebBrowser.Navigate(loginUrl);
            }
            catch (Exception ex) { }
        }
private void MyWebBrowser_Navigated(object sender, NavigationEventArgs e)
        {
            var fb = new FacebookClient();
            FacebookOAuthResult oauthResult;
            if (!fb.TryParseOAuthCallbackUrl(e.Uri, out oauthResult))
                return;
            if (oauthResult.IsSuccess)
                LoginSucceeded(oauthResult);
            else
                LoginFailed(oauthResult);
        }
public void LoginSucceeded(FacebookOAuthResult oauthResult)
        {
            // Hide the Web browser
            MyWebBrowser.IsEnabled = false;
            // Grab the access token (necessary for further operations)
            var tokenLoc = GetAccessToken(oauthResult);
            token = tokenLoc;
            var aux = new FacebookClient(token);
            aux.GetTaskAsync("fields", "id,name,email"); //Test, I want this variables
        }
</code></pre>

<p>I've tried to understand the API and also to see some examples, but the ones I've manage to find seems outdated and didn't worked.</p>