0

hello there i am trying to integrate facebook services in C# desktop application, i have also created facebook appId The Code i used for logging in using webBrowser is`

private const string AppId = "xxxxxxxxxxxxxxx";//My AppID 
    private Uri _loginUrl;
    private const string _ExtendedPermissions="User_about_me,publish_stream,offline_access";
    FacebookClient fbClient = new FacebookClient();

public void Login() 
    {
        dynamic parameters = new ExpandoObject();
        parameters.client_id = AppId;
        parameters.redirect_uri = "https://www.facebook.com/connect/login_success.html";
        parameters.response_type = "token";
        parameters.display = "popup";
        if (!string.IsNullOrWhiteSpace(_ExtendedPermissions))
            parameters.scope = _ExtendedPermissions;

        var fb = new FacebookClient();
        _loginUrl = fb.GetLoginUrl(parameters);

        webBrowser1.Navigate(_loginUrl.AbsoluteUri);
    }`

but it is showing "Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings." i think i have to create appId for desktop application but could not find any solution yet, Please help!

Durgesh Pandey
  • 2,314
  • 4
  • 29
  • 43
  • where do you guys keep copying your code from? publish_stream and offline_access are gone since many years. and it´s "user_about_me", not "User_about_me". about your error: that´s been discussed in countless threads on stackoverflow already. – andyrandy Jun 05 '16 at 16:23
  • @luschn I have the same problem. Code is from 5-10 years old articles from sites like codeproject, because (IMHO) of critical lack of at least simplest but complete actual authentication examples in API documentation **about C# desktop applications**. I mean all other API is ok, but the very first step with getting token is really unclear. – Sam Jun 15 '16 at 13:43
  • just don´t use permissions that are deprecated ;) - check out the api reference to find out which ones still are there. – andyrandy Jun 15 '16 at 17:39

0 Answers0