Following a successful share on Facebook with URL
https://www.facebook.com/sharer/sharer.php?&u=http%3A%2F%2Fwww.cars.com
a user is redirected to
https://www.facebook.com/dialog/return/close?#_=_
How can we set the redirect_uri without creating a facebook application?
https://developers.facebook.com/docs/sharing/reference/share-dialog contains no references to https://www.facebook.com/sharer/sharer.php
Create an application id APP_ID by navigating to developers.facebook.com.
Create GET Request. Ex: request to developers.facebook.com redirecting to www.aol.com
https://www.facebook.com/dialog/share?app_id=APP_ID&display=page&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F&redirect_uri=https%3A%2F%2Fwww.aol.com
Related
what I need: upload photos to user's fan page as a page, using an app for that
what I have: my website which does uploading, and a user, who created fan page and application, and that app's id and secret
what I do:
call FB.init() with that appId
call FB.login() with manage_pages,publish_stream permissions - this prompts FB login popup where user is asked to login and then to authenticate the app. As the result I get app access token.
Send request to https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=TOKEN_FROM_ABOVE to get extended app token valid for 2 months (and therefore page tokens will be extended as well as described here)
Send request to https://graph.facebook.com/me/accounts?access_token=TOKEN_FROM_ABOVE to get a list of pages user manages, and let user to choose the page he wants to publish to.
That gives me PAGE access token I can use to publish photos to user's FAN page using /albumId/photos/ API call.
what is the problem:
the "via" link in the photo redirects user to MY website (where user has authenticated his app to upload to his page):
that is because I had to ask user to enter my website's URL in app settings, otherwise Facebook login dialog will complain:
SO MY QUESTIONS ARE:
Am I doing this right? am I missing something probably?
If I am - then how can I get that "via" link to link to user's website?
Thank you.
how can I get that "via" link to link to user's website?
Not at all, because this always links to the app that was used making a post/upload.
What you could try though is having your website redirect when a user is coming to your site from Facebook. Which post/feed story the user is coming from should be passed to your site as parameters; then you’d only have to figure out which user made that post (look it up in your database), and redirect to their homepage.
I ended up adding client's website URL as a query string parameter into "Site URL" field in the application settings - and then I need to modify my site's backend to do redirects:
http://mysite.com/?redirect=http://client-site.com
I have created an app(canvas page) on facebook using PHP. I see that users without logging in to facebook can see the canvas page http://apps.facebook.com/svolzesocial
How to redirect user to facebook login page before using app?
For example, when we open Mashable Social reader, if the user is not logged into facebook he gets redirect to another facebook login page like as shown in image below.
http://i.stack.imgur.com/zwceW.png
I want exactly like this only.
Since your page is in a canvas app, you should be receiving a signed_request parameter posted to your server. You should decode the request and determine if the user has already authenticated your app. If the user has already allowed your app, just serve up the page they requested. Otherwise you can just serve up a blank page that contains JavaScript call to redirect the user to the login screen.
Will the facebook fetching a tab application differs according to different login?
If I am login as application admin or page admin then facebook fetches the application through POST and if i am login as a normal user, then facebook fetches the page through GET
As I know, Facebook integrate with your app (iframe) with only one method (i.e POST). Everything you put on app URL facebook will post to your iframe.
For example apps.facebook.com/your_app/id/1, Facebook will POST id=1 to your iframe.
However, you can check an user whether is an app/page admin or not by using Open Graph API:
http://developers.facebook.com/docs/reference/api/page/#admins
I think you question somehow relate to this:facebook application API check if user is application admin in facebook
Hope this will helps.
I am working on the FaceBook Javascript API.
I want to know if there is any way in which we can find out if a user has authorized a web site or not.
if authorized, the signed_request attribute from facebook will have a user_id in it (after decoding it with the website's oauth_secret )
I am new to Facebook app development and have stumbled across a road block. After reading the documentation, I sort of understand that the process of using Facebook login is done in there steps: user authentication -> app authorization -> app authentication. I see where the app authroization/authentication is done, but I can't seem to figure out how to bring up a "user login" screen of Facebook on my WPF. Can anyone advise? Thanks!
First of all you need to register a application in Facebook. Don't forget to give a canvas url when registering an application. After registration you should get app id and app secret values.
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL
YOUR_APP_ID means your application id
YOUR_URL means that application canvas url.
Wpf has a web browser control, you just call the Navigate function and give this url. You should get a Facebook login dialog.
After giving the correct user id and password, Facebook should popup a permission dialog then click the Allow button , you should get a code with redirect url. Then you should parse the code from this url and create a web request to get an access token:
https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL& client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE
YOUR_APP_ID is application id
YOUR_URL is application redirect url
YOUR_APP_SECRET means application secret
THE_CODE_FROM_ABOVE code get from above.
After executing this request, you should get an access token. Using this token you can access Facebook functionality from your application.