Social Media Linking - facebook

I've done a little searching and was wondering if there is a way to link a users account in our web app with their social media accounts they choose to link (facebook, twitter, etc). i.e. when they log into our web app they are auto logged into facebook, twitter, etc?
I see facebook has an api to login to our web app using their facebook book account but I want it to work the other way around, I want them logged into facebook when they log into their account via our web app.
Thanks,
Ryan

It is definitely possible-from your question I assume you would like to pull data and make actions on behalf of a user? If so, you will need the offline_access permission as well as all the other permissions you will need (check out the list here to see exactly which ones you require). Then, you can trigger a script on your server that tell facebook as soon as the user is logged in to your site, to log in your application as the user as well.
NOTE: You might be going about this in the wrong way. I would advise that you specify a bit more details on what exactly you need the user to be logged in for, and I can (probably) provide you with a decent answer.
EDIT: In response to your question in the comment, Ryan, here is my answer:
You need to divide this problem into 2 different situations-one: your company wants you to write all the code from scratch and don't use what facebook has to offer, in which case you should create a custom login script that enables your users to use their facebook account as the Actual user account in your web app. This is the best solution in my opinion, and is supported by the ever-so-awesome Jeff Atwood. Here's a link to how to do just this, and a tutorial about this also.
Or your company is comfortable with using Facebook's Social Plugins.
Then you should focus on Like Button & Comments : These social plugins are the best way to enable people to create social experiences if they're already logged in.

Related

Permanently associating a website's account to facebook account

I have the task to integrate some commercial sharing stuff into a website.
The idea is that the user a) logs in/registers in the website, b) the user connects his user account with his facebook account - by adding and accepting the website application.
Here comes the interesting part - is there a way of linking the facebook account with my website's account so that I can send them updates and promotions directly to their walls programatically?
In the application dialog, it's clearly noted that the user allows the application to write to the user wall so they accept and agree this. Then, for example, if I want to send them a promotion or update directly on their wall using the fb application api, how can I achieve this? All the tutorials I've read consider the user using the Facebook Login
The concrete idea is something like weekly promotion feed that my clients want to allow customers to allow being posted directly on their walls. As I don't have any experience with facebook development, I'd appreciate knowing how, if at all possible, this can be achieved?
Most of what you're suggesting is against policy, and isnt' technically possible either as users need to come back to the app once every 60 days for you to have a valid access_token for them.
The Authentication docs explain how to get access to a user's information with their permission, and the Permission documentation explains which permissions grant access to which functions or fields.

How to authorize Facebook App for basic permissions without showing Authorization Dialog

From the documentation it seems that the user should always authorize the Facebook application even to access basic permissions.
However, sites like Rotten Tomatoes and Clicker.com auto-authorize the logged facebook user without showing the authorization dialog. If you visit one of those sites for the first time they will be able to access your public data without you authorizing it. If I go to the Apps on my facebook settings, an entry will appear showing that I gave access to those applications (but I DID NOT).
How can this be possible? Is it related to the "Instant Personalization" feature for selected partners?
Thanks
Well, I was doing some research and yes, it's all about Instant Personalization.
From Facebook:
We've partnered with a few websites to provide you with great,
personalized experiences the moment you arrive, such as immediately
playing the music you like or displaying friends' reviews. To tailor
your experience, these partners only access public information (like
your name and profile picture) and other information you've made
public.
From one of its partners:
Clicker.com
So -at the time I'm writing this- unless you're a partner of Facebook, you'll have to show the old OAuth dialog.
Hope it helps!

Anyone know of a good tutorial for Facebook authentication?

I'm linking my app to Facebook, and would like people to log in with their Facebook account, but I can't figure out how to do this. I had read up on Facebook Connect, but it seems that that's not used any more - but every tutorial I can find seems to refer to it. When I try to follow them, it doesn't work, because the interface has changed.
So, can anyone direct me to a tutorial or guide to doing this the new way?
Basically, what I want to do is this:
A user who is signed into Facebook and comes to my webpage is automatically logged in to my app (with the usual Facebook 'granting permission' windows etc), or can sign in with their Facebook account if they're not already logged in.
I then want to use Facebook to link users with their friends who are also registered on my site, so they can share things.
I would also like to have access to Facebook comments made on wall posts from my site - so the comment stream for a particular post can be seen on my site as well as on Facebook, and comments can be made on either.
If anyone can point me in the right direction (or even tell me what I should be typing in to Google!) I'd be very grateful.
Thanks.
Some sample apps that do many of the things you speak of are shown here. The Graph API is probably your best bet right now for delivering the content and access you need and there are numerous tutorials online for how to use it, including the Facebook Developers site itself.
You will find good Tuts on ThinkDiff, e.g.
http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/
http://thinkdiff.net/facebook/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/
http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development-php-sdk-3-0/
I know this is an older question, but the current method for authentication is OAuth 2.0.
Facebook provides a pretty good outline of what steps are necessary in this Reference:
https://developers.facebook.com/docs/authentication/client-side/
This example allows the authentication to occur entirely in Javascript on the client side so that you can request a potential user to authenticate via Facebook and then confirm access to your application.
If the user is already logged in, only the access confirmation for your application is performed.
If the user is already logged in and access has already been granted, the user is not required to login, or reconfirm access.

Check whether user of non-facebook app likes/shares particular URL on FB

I'd like to know if there is a possibility to check (using Graph API or any other way) whether given user likes / shares a specific link. Probably I'll have this user's facebook ID or facebook login, but my site is non-Facebook application. Actually it's Dot Net Nuke portal (target: .NET with MS SQL Server) with part of it being avaliable as Facebook app, but certainly not greater part of it, so the solution should be out of Facebook Connect, although it's not a showstopper if it's necessary.
We'll be giving points to users who share/like most of links that we serve in our portal and such possibility would be a great help to make a ranking.
Another option we consider is making some kind of "wrapper" or proxy for FB like / share buttons which will at first save some data in our database (probably - this user clicked on like for this link) and then go on with standard FB like / share route. Did anybody of You tried such solution?
If You have any other suggestion on the subject, please, post them, we'll be really thankful.
It is possible to know if a user has LIKED a site or not. You can get all user's likes with Graph API (you need user_likes permission). Take a look at the docs: http://developers.facebook.com/docs/reference/api/user/
I'm not sure if you can know if he has shared your site, but you could try by parsing his wall with the read_stream permission and then look for your site name/URL post by post.
For just general liking of items on your site, you can use a Facebook Social Plugin. However, you won't be able to associate (or really even access) user activity with users on your site without integrating Facebook Connect and creating a Facebook application for your site. At that point you can design with greater control all the possible user activity and interleave with your facebook calls other calls that affect users' accounts on your site.

Can I use the facebook credentials to for users to access my site?

I'm starting to work on a site that will be strongly connected to a corresponding Facebook app. I want the contents to be free for all to view, but only registered users will be able to edit it (quite similar to serverfault, actually).
Since I think that most of my users will be logged in to facebook, I would really like to use their facebook credentials as to login to my site - the same way Open-Id registration works here.
Can this be done?
Thanks,
Udi Pasmon
Yes, this is one of the things provided by Facebook Connect. There is a wiki full of documentation - start at "Authenticating Users with Facebook Connect".