Where is the Facebook API Key in the new layout? - facebook

well I'm just wondering where the facebook api key went, now all I see is the secret and the app id. But nowhere can I find the api key

The app ID and API key are the same thing. If you go to the Developer app and click on one of your applications, you'll see the label is "App ID/API Key".

Related

Is it possible to request a new secret key for Facebook API programmatically?

Is there a way to request a new secret key for Facebook via the facebook API? Essentially I would be using my own secret key to request a NEW secret key, for key rotation purposes.
I looked through the Facebook API documentation but could not find anything about this operation. I suspect they won't support it, but I would just like to confirm that there isn't an automatable way to rotate your API keys? Thanks!
I assume you mean "Access Token" when you say "Key", and you are talking about "User Access Tokens"? That´s not possible, you can only get a new User Token on user interaction. More information:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Not sure what you mean with key rotation, but the User Token is the only "Key" that can´t be valid forever, so i guess that´s what you are talking about...
Edit: Seems that you are indeed talking about the "App Secret", which can not be changed with the API but you can change it in your App settings. A rotation only makes sense if someone got your App Secret by accident or if some security issue happened. Better read this and only allow API calls server side: https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof

where do I get a client_id from?

I am new to Facebook based development and just require a basic Facebook registration form, I've found the "registration form and its html to embed into my website", but need a client_id so I can use it. Where do I get this from?
http://developers.facebook.com/apps
After creating an app, the App ID / Client ID is shown.
Finding Facebook App ID, App Secret and Client Token:
You can find your App ID and App Secret in Settings/basic:
The Client Token can be found at Settings/advanced:
https://developers.facebook.com/apps/Your_App_ID/settings/

how can I find the owner of a facebook app ID?

A while back I created an app ID on facebook and added the appropriate meta data to a website. I now want to continue adding facebook-related features to the site, but it seems the app is not related to my account afterall.
I must have created it under a different account or something, but how can I find who the owner is based on an App ID? I have existing likes, so I don't really want to change the App ID. I don't see any way in the UI, and I do not see the app when I go to the Developer app. Is there a way to do it using the Graph API?
If you have access to the app id and the app secret but no access to the app within Facebook it is possible to discover the creator_uid and from there the email address of the app owner using the graph api.
First get an app access token:
https://graph.facebook.com/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET}&grant_type=client_credentials
With this you can get the creator_uid:
https://graph.facebook.com/{APP_ID}?access_token={APP_ACCESS_TOKEN}&fields=creator_uid
Using the app token you will then get the email address when looking up the creator_uid in the graph api:
https://graph.facebook.com/{creator_uid}?access_token={APP_ACCESS_TOKEN}
EDIT (Jan 2013)
Looks like Facebook have removed app profile pages so that method no longer works.
Option 1
You could return the app object, which stores all the populated information about the app by requesting:
https://graph.facebook.com/xxxxxxxxxxxxxxx
Option 2 (This method no longer works)
Or, you could visit the app's profile page and contact the developer directly using the 'contact developer' link:
http://www.facebook.com/apps/application.php?id=xxxxxxxxxxxxxx
(you'll need to replace xxxxxxxxxxx with your app id)
I got this working. If you have both app id and app secret then you can try below steps to get the owner details.
Get the access token using id and secret of the facebook app.
https://graph.facebook.com/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET}&grant_type=client_credentials
Using the access token you can call the below API to get a list of administrators of the app.
https://graph.facebook.com/{APP_ID}?fields=id,name,roles&access_token={ACCESS_TOKEN}
Retrieve the owner profile details by,
https://www.facebook.com/{USER_ID}
I have a similar problem, in that I have the id and the secret but no access to the app within facebook.
I haven't found a way to see who owns does have access to the app. But I have found a way to contact a dev
First get the app access token.
https://graph.facebook.com/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET}&grant_type=client_credentials
Then get the address:
https://graph.facebook.com/{APP_ID}?access_token={APP_ACCESS_TOKEN}

Why an Facebook/Twitter app has to need 2 keys?

I'm developing an mobile app on the iPhone.
After creating an app on Facebook/Twitter, I received 2 keys:
Facebook call them as app ID and app Secret
Twitter call them as consumer Key and consumer Secret
When I use OAuth authorization as some tutorials on Google, my app must provide both keys to proceed. I'm confused as to why it needs 2 keys. As their names (id and secret), I guess that their roles is equal to public/private keys pair in Linux. But I must provide both 2 keys so that my app proceeds.
I want to place the secret key in my own Apache/PHP server, the secret place, not in my app's code. My app is only responsible for authorization, then my server proceed with other tasks, as posting,...
The app id and consumer key are identifiers of your app. The secret is what you share with the service provider in order to authenticate requests and such. Like a username (identifier) and password (secret).
The secret must not be shared - this is in the developer policies. Doing so would allow other to access the data of your app users which would obviously be a serious privacy breach. So you are right to plan on keeping it out of sight. Your app id is publicly available to anyone, so you can put that where you want/need.
AppID is used for authentication, appSecrect is used for other tasks.
Consider these two documents of Facebook and Twitter about authentication for web app for more detail:
http://developers.facebook.com/docs/guides/web/#login
https://dev.twitter.com/docs/auth/oauth
Consider this flow for an implementation Facebook/Twitter app on mobile if you have an own server for the secret:
OAuth Twitter with only Consumer Key (not use Consumer Secret) on iPhone and android

Facebook API key? Same as Application ID?

I've setup an application for my site via facebook & unlike other screenshots I have seen on the web where it shows an API key, I DO NOT have one.... all I have shown is "Application ID", followed by "Application Secret"..... so was wondering if the App ID is the same as the API key? As I am using the App ID with another WP plugin?
APP ID, APP KEY and APP Secret are three different things.
APP ID is a unique number(integer) for each application on facebook.
The following URL link should land you on your application dashboard page, where you can see all the application which you have created on facebook. After that, click on the application name which you have created recently and you should be see your application id, key, secret and other settings.
:)
UPDATED, PLEASE READ BELOW:
As of 2011 APP ID and API KEY is now the same value, and is listed as such under the label App ID/API Key on the app details and settings page.
App ID and API Key were different before. But since the introduction of the new Developer dashboard. They are now the same.
You now can use App ID where your code requires API Key.
You can in fact still get an API key via public FQL query:
https://api.facebook.com/method/fql.query?query=select+app_id,api_key,+canvas_name,+display_name+from+application+where+app_id+%3D+'enterYourAppIdHere'
You can still get the API Key.
Go to http://facebook.com/developers/apps.php
You can find API key, API ID and APP secret of your facebook apps.
Go to https://developers.facebook.com/apps/.
You can see App ID and App Key is same and it is numeric and App Secret is associated with app key.