Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API - What should the redirect URL be for a desktop/native application?

Tags:

facebook

I am developing a desktop application that will interface with FB. FB insists that you provide a Site URL. Since this is a desktop application this doesn't really make sense. I set the site url to 'localhost'.

I just get the following error when I put 'localhost' in the url string

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: redirect_uri isn't an absolute URI. Check RFC 3986.

This looks like a pretty common error but I don't see any examples of how desktop applications should handle this site url requirement.

Can someone help me out?

Thanks

like image 821
Nick Avatar asked Sep 01 '11 04:09

Nick


People also ask

What is Facebook redirect URL?

Your redirect URI will typically have the format https://engage-app-name.rpxnow.com/facebook/callback. For example, if your Engage app has the name my--test-app, your redirect URI would be https://my-test-app.rpxnow.com/facebook/callback.

Where is redirect URL in Facebook app?

In your app settings on https://developers.facebook.com/sa/apps/<my-app-id> , make sure that you add the Facebook Login product. Then under "Client OAuth Settings" enter the URL in the "Valid OAuth redirect URIs" box.

How do I use OAuth on Facebook?

Make sure the URL of your site is defined when configuring the Facebook application. Create an OAuth2 Token asset. On the Details screen, enter the ID and Secret provided to you by Facebook in the Client ID and Client Secret fields. In the Authorisation Endpoint field, enter https://graph.facebook.com/oauth/authorize.


1 Answers

Pays to read the documentation to the end :)

Our OAuth 2.0 implementation does not include explicit desktop app support. However, if your desktop app can embed a web browser (most desktop frameworks such as .NET, AIR and Cocoa support embedding browsers), you can use the client-side flow with one modification: a specific redirect_uri. Rather than requiring desktop apps to host a web server and populate the Site URL in the Developer App, we provide a specific URL you can use with desktop apps: https://www.facebook.com/connect/login_success.html.

like image 58
Nick Avatar answered Nov 15 '22 10:11

Nick