getting facebook user_id on the fly - facebook

I was wondering if its possible to get LOGGEDin facebook user_id once they visit my website, without click on any login or fb.connect or even using API ? can we get facebook logged user_id ?.. cheers

You can not get the logged in facebook user_id without using the API because it not only violates the browser's security, but also Facebook's (not to mention the user's privacy).

Yes, you can use the javascript API. Use the FB.getLoginStatus function. If they are logged in, the session will contain their user ID.

You seem to be confused, let me try to clear a few things up.
When you say "without the API" what you seem to mean is "without them giving permission." Even if you don't use "The API", you'll still be required to get permissions before you're able to get access to their account data using your access token.
If you're looking for ways to have Facebook stuff on the page that doesn't require authentication, try Facebook's Social Plugins: https://developers.facebook.com/docs/plugins/ Basically, they run inside of a Facebook , so the user is interacting with a Facebook widget on your page, but your server doesn't get any access to their data.

Related

Do review required if we want to get Facebook Page like count (Without Facebook login) by Facebook app token?

I am doing a static web page in my website, in which I am showing the like count of particular Facebook page. There is no kind of login required to see this web page. Also, I don't want to user to login with their Facebook account to see the Facebook page like count.
I have implemented this requirement by using Facebook app token.
API: "https://graph.facebook.com/PAGE_ID?access_token=APP_TOKEN"
But the problem here is, If I use the app token of already approved app by Facebook with some permissions (manage_pages) exists, it works. It is not working for the app token of newly created Facebook app.
I have sent the app for review to Facebook by requesting manage_pages permission, but they rejected the app and said that my website doesn't have the Facebook login functionality implemented.
Since it is not documented clearly, I have a doubt that do the app need to send for review if I want to get the Facebook page like count without Facebook login (By using Facebook app token)? If yes, what permission do I want to request?
Any help would be much appreciated.
First of all, you need to learn what Tokens there are:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
For your problem, you can just use an App Access Token. There is no need for any permission or Login Review, the links above tell you exactly how to create one. Make sure you never use the Token on the client, especially because it includes the App Secret. Do the API call on the server only (file_get_contents or curl, if you use PHP).
If by "it does not work" you mean that you only get the id and the name, then it´s not about "not working", you need to read the changelog and search for "Declarative Fields": https://developers.facebook.com/docs/apps/changelog#v2_4
So if you want to get more than just id and name, the API call would be like this: https://graph.facebook.com/936299239766048?access_token=YOURAPPTOKEN&fields=id,name,likes,...

get Wall Facebook messages without Authentication

Do you know if there is any way to publish on my web app the facebook messages published by the users on my facebook wall application?
I'm using spring social and I tried to use the code you can see below:
facebook.feedOperations().getPosts()
With this sentence, it is launched an exception alerting that Authentication is needed.
Thanks.
Regard
Nope. If you could, then Facebook would need to seriously evaluate their security. The user needs to give you permission to access their data. After authenticating can use the returned user token to access the user's Facebook wall posts.

Facebook account to replace registration?

I'm new to all this. This is what i'm after and i'm sure it's possible.
I've got a script where people can register/login in to as members. What i'd like to do is tie it in so that it just uses Facebook users details for the registrations. I've managed to set it up to sign up and and complete a registration using a user's name and email.
What i'd like to do now is automatically log the user in if they're logged in on facebook, is this possible or will they need to click a login button that then takes them to their page? If they need to click a button to login, how do I go about getting the button to take their facebook details and log them in? Also what happens in regards to passwords on my site? Is that stored in the app somehow?
Ideally i'd like to use the popup version of verification rather than the iframe that i've got set up at the moment.
Cheers in advanced for any help for a n00b!
This is in fact possible. Although I for my part was never a fan of such things here's some human-readable (simplified) theory:
Facebook uses a system called OAuth ( http://de.wikipedia.org/wiki/OAuth ). That means, when you want to have the user login onto your site using Facebook you'll of course need to provide a button/facebook-login-frame (see documentation) that says "Log me in with Facebook" or so. You then access Facebooks API (more here: https://developers.facebook.com/ ) and basically tell Facebook who you are ("Hi I'm website XY"). While that happens your user is redirected to Facebooks "permission-landing-page". On that page he needs to confirm whether he is fine with your website accessing certain information (like his name). If he confirms your website receives an access-token granting you access to a subset of his user information which you can then use to personalize his expeirence on your website.
Check out facebooks documentation because they explain exactly your usecase in detail.
(here: https://developers.facebook.com/docs/authentication/ )
PS: You'll of course never have any access to his Facebook login/password. That's kind of the idea behind "delegating" the authentication via OAuth to Facebook. Facebook only provides you with an access token (bound to that particular user who logged in and granted your app/website permissions)

Facebook app without prompted authentication

I've been trying to figure out a way to have my iframe Facebook app (built in PHP) work without requiring separate authentication methods. I am already logged into Facebook, but for some reason I still see all these Oauth notices from the example in the PHP SDK.
The only data I need is publicly available even without them "adding" my app. I am looking to collect their Facebook ID (since this is a contest, we need a unique ID for tracking), their name and (optionally) their email address as well.
The problem is, I cannot use the API to fetch the public information unless I already know their Facebook username. Any ideas on how I might be able to get their logged-in username or public handle so I can then fetch the rest of the information?
For whatever reason, Oauth is driving me completely insane with Facebook today.
Sidenote:
I did manage to technically get the Javascript SDK operational, which fed some information to PHP for use. The only issue there is that once I login, I don't see the data. If I refresh...then it shows up. Unsure why the refresh is required, as I wouldn't expect a user to actually have to hit refresh in order to proceed with the app.
I guess you are a bit confused here, Facebook will NOT share the username, id, full name or email without the user explicitly authorizing/allowing your application (and in the case of the email, requesting the email permission!).
Read the official Canvas Tutorial for more information:
In order to gain access to all the user information available to your
app by default (like the user's Facebook ID), the user must authorize
your app.

Get facebook comments with the graph api without user authentication

I'm building a flex application using the http://code.google.com/p/facebook-actionscript-api/ library.
Is it possible to get all the comments for an OBJECT_ID (https://graph.facebook.com/OBJECT_ID/comments) without the current user being logged in facebook. If it is, please tell me what the OBJECT_ID needs to be (post in public group or something else).
Thanks in advance.
blz
You need to request the offline_access permission. It will give you an access token that won't expire. Save it in your database and use it for your connections and it will work without the user.
More: http://developers.facebook.com/docs/authentication/permissions/
I believe Object_ID is the user, and they do not have to be logged in for you to acquire this
But...
What you probably will require is authentication of your request. I believe FB now requires that you register your webapp with them to get the necessary OAUTH signature. I think this is as of F8 2010.