Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login for desktop apps

Our desktop app (written in Java and running on windows but not registered on the Windows app store) needs to publish images on the user's Facebook profile (using publish_actions rights).

While our implementation works in test mode (we're able to publish on test user's profile), our application submission for approval has been rejected by Facebook with the following comments:

enter image description here

Our current implementation is as follows:

  • We are using the "Manual Login Flow" (as described here: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.2), based on an in-app web browser
  • The login URL we use is: https://www.facebook.com/dialog/oauth?client_id=xxx&redirect_uri=www.mydomain.com/login_successful.html&response_type=token&scope=publish_actions (where mydomain.com is our actual website and xxx is our app's id)
  • On our app's configuration (http://developers.facebook.com) we have indicated "Website" as platform (since all others require an apps store app ID), and have provided our website domain as Site URL (keeping Mobile Site URL empty)
  • We also indicated in the app's advanced configuration that it is a "Native or desktop app" and that the "App Secret is embedded"

As this approach has been rejected by Facebook when reviewing our app submission (although it did work in test mode), we tried an alternative approach:

  • Remove "Website" platform from our apps configuration (i.e. no platform is defined for our app)
  • Change the redirect_uri (in the login URL) to https://www.facebook.com/connect/login_success.html

But unfortunately this generates the following error message when loading the login URL:

Given URL is not permitted by the application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

Any help or hint is more than welcome as we have been blocked on this for weeks now. Thanks! Thomas

like image 679
Tom Avatar asked Feb 21 '15 16:02

Tom


1 Answers

Regarding the error message "Given URL is not permitted...": the following thread might be helpful: facebook v2.2 login C# ("Just enable the "Embedded browser OAuth Login" button and it will work."). You can find this button in your Facebook apps-settings under "Settings" - "Advanced" section "Security".

like image 192
user2458859 Avatar answered Oct 04 '22 07:10

user2458859



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!