Facebook email Permission, OAuth2, doesnt work? - facebook

since the new Auth Dialog from Facebook (for my App & homepage), I cannot get the dialog to show that my homepage/app needs the users email when connection to my homepage/app.
In the Auth-section of my app I've added "email" to the User & Friend Permissions. Also I've added it to the referal when someone clicks the "Login with facebook"-button.
When someone clicks the Facebook-button, he/she redirects to a page which has the PHP-code with Facebook SDK PHP (latest). Here's how I generate the send-to-url for the dialog:
$login_url = $facebook->getLoginUrl(array('req_perms' => 'email,publish_stream'));
header("Location: ".$login_url);
But when the Dialog pops up, the only permission request it does is "basic information". I need to request the Email. Am I stupid or is it a bug somehow? I've also recreated the App.

There in no req_perms parameter anymore, it's called scope in OAuth2.
Read documentation for getLoginUrl to see correct parameters.

in new dialog there are 2 kind of permissions normal permissions & extended permissions
you should install app with normal permissions at first then page will redirect automatically
for extended permissions

Related

fb app not requesting all permissions

I´ve written a facebook connector app which should request some permissions.
When I click the preview login dialog button in the applications edit menu all the permissions are listed but when I open the login dialog from my website only the standard permissions (general user information) are requested. I´ve already saved it several times and waited for hours but it doesn´t work.
Am I doing anything wrong or did I just discover a bug or something?
Thanks.
The permission settings in your Facebook application configuration only apply to auth dialogs from the Facebook app center. You need to specify the permissions you want when you are opening the login dialog from your website. For example, if you're using the Javascript SDK's FB.login to do login, you will need something like
FB.login(function(response) {
// handle the response
}, {scope: 'email,publish_actions'})
Pay particular attention to the scope parameter.

Facebook Page update through external page

I'm new to Facebook App development and I got this Problem:
I've created a Facebook Page (so I'm the administrator). Now I would like to have an external Webpage with a simple textarea and a "send" button. So everybody who has the link to this page could update this Facebook Page even without a Facebook account. This status update should be send by my page administrator account.
I thought I could write an app and authorize this app to publish_streams on the page and after the authorization I could switch $fbuser = $facebook->getUser(); to $fbuser = IDOFMYACCOUNT.
So the fbuser would be always my account wich is allowed to post to the Page.
If I try to use this application with an other browser (wich isn't logged in to my fb account) I get this error: (#200) The user hasn't authorized the application to perform this action
So this is the way I thought I could solve my problem.
Do you guys have an idea how I (and other people who don't have a FB account or don't wan't to login or I don't want to add them to Facebook Page administrator) could update the Facebook Status of a Page from an external website?
You will need your token "baked in" to your code and some sort of admin back end to update the access token before it expires.
Also you need manage_pages permission and the token of the page if you want to post as the page.
This can be accessed from /me/accounts

Can we show Facebook permission Dialog Directly(my app is already authorized)

Basically I want to check the extended permissions the user has granted my app.
If any one permission that I want is not given by the user, Then I want the user to be redirected to facebook permission Dialog(Not the oauth dialog which comes first).
Is it possible to do that using php or js sdk(php preferred).
Then I want the user to be redirected to facebook permission Dialog(Not the oauth dialog which comes first).
First of all, there’s a misunderstanding on your side here: That is only one dialog, it’s only split into two pages where appropriate.
So when asking for (more) extended permissions, you just call the OAuth dialog the normal way (getLoginURL in PHP SDK, FB.login from the JS SDK) – if the user has already authorized your app and only new extended permissions are required, then only the second page of the dialog is shown automatically.

Facebook Enhanced Auth Dialog not Appearing when User is Not Logged In

If a user follows a link to my Facebook application (apps.facebook.com/instantinternetstar) and they are not currently logged into Facebook they are allowed to enter the Application instead of being prompted to 1st log into Facebook and 2nd grant permissions via Auth Dialog.
If a User is logged into Facebook, the new Enhanced Auth Dialog works perfectly and always.
Is there a variable I have missed?
Your settings may be fine. What you can do on the default page of http://instantinternetstar.com is to query the http post parameter called signed_request, decode it and it will tell you if the user is authenticated or not. Then you can display something to them so they know what you're about, before they take their time to login to Facebook, then accept your app.

Facebook Permissions Dialog in Page

I've created an app that works fine, however if the user has not authorized my app yet, they have to do the following (assuming they are in facebook AND logged in) -
go to my app
click login/authorize
popup with facebook permissions opens
accept in the popup
However I noticed with Zynga games like Mafia Wars 1/2, Farmville etc, when you go to the app, if it hasn't been authorized, it takes you straight to the permissions which is in a PAGE and not a popup, thereby eliminating one step. Also, the permissions dialog is full width, there is not app sidebar.
Does anyone know how I can duplicate this flow? It would be much easier to have users authorize within a facebook page rather than through a popup. How can I get permissions inside the page?
thanks in advance
Once user visit a Page tab with your application you can check if he is connected with your application by comparing Page ID with User ID in signed_requests, for unauthorized users ID's will be same. In that case you can start authentication flow by redirecting user's browser to "login url".
If you want it to be full page just do the redirect with JavaScript like this:
window.top.location = 'https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=COMA_SEPARATED_PERMISSIONS'
If you using PHP you can construct Login URL by calling Facebook->getLoginUrl method.
Read the docs on Facebook authentication