How to publish as a Page without requesting extended permissions from a user? - facebook

I have one Facebook App that I only use to authenticate users on a website, get their names and profile pictures.
I also have a Facebook Page related to that same website.
My personal profile is administrator of both the App and the Page. Also the Page is registered as "App Page" in the advanced settings of the App.
I want to publish on the Page from a server using the Graph API and the credentials of the App without the need to ask for extended permissions such as manage_pages or publish_pages from my users because I don't need them (see point 1). I don't want to publish on their page, only on mine.
How do I make my App "administrator" of my Page so that no additional permission is required for the App to publish on behalve of the Page?
I know a quick and dirty solution would be to create another App that would be just used as a gateway between my profile and the Page (I would be the only user of the App, granting all the required permissions). But I would like to avoid having two different Apps.

If you want to publish "as Page" on your Page, you need to authorize your Facebook account with manage_pages and publish_pages and get a Page Token. That is the only way.
You can use an Extended Page Token and store it:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Related

Facebook App Review - How to allow FB reviewer to test manage_pages permission?

I have an app that allows users of a (basically)WordPress site to share their posts to their Facebook business page (not user feed). Everything works great, I just have to submit the app to FB for review because I need the manage_pages and publish_pages permissions. How do I allow the Facebook reviewer to test this functionality when they need to have permissions attached to a FB page to be able to share a post to it?
I have created a login on my site for the reviewer. I have also created a test user on the app that the FB reviewer will be able to use, and I have used that test user to created a test page but the page is not accessible by my app or by any other user. The test page is set to Public. As I understand from what I've read in the FB docs, content by a test user (I'm assuming an FB business page qualifies as "content") is only visible to other test users. How can I set this up for FB to be able to review this?
As pointed out by CBroe, Facebook testers have their own pages with which to test permissions like this. I was over-worrying.

Graph API v2.2 : user_status permission is obtained from facebook but still cant get the v2.2/me?fields=statuses data

I have an app & user_status permission is obtained from facebook after its submitted for review. I can get the v2.2/me?fields=statuses data for the App's admin. No other fb accounts are able to get this data. When I login with facebook from my portal, the permissions requested are not shown to the users.
Is the issue related to FB API. I can use the obtained permissions only for the App's admin alone?
Is this issue related to not obtaining consent from the account while logging in from my portal. If yes, what is the method to get this done.
Anyone kindly help me regarding this.
It's all in the docs:
https://developers.facebook.com/docs/apps/review/login#do-you-need-review
...your app's developers will be able to see, and grant, any permission without requiring review by Facebook.
and
People who are listed in your app's Roles tab will have access to extended permissions without going through review (e.g. publish_actions or manage_pages). For example, if you use the Facebook Plugin for Wordpress to publish your blog posts to your Facebook Page or Profile, you do not need to submit for review so long as all your publishers are listed in your app's Roles tab.

Facebook app - Do i need those permissions?

I created an app for my clients. They uses this app from their website to post on their Facebook Page (and as the Facebook Page).
they use a Facebook Login button to connect to Facebook (with an account that can publish post on the page) from their website,
they complete a form
when the form is submitted, an article is created on the website AND a post is created on the FaceBook Page.
I ask for publish_action permission and manage_page permission when the user connects.
Those permissions need a review from Facebook, so I ask for it but the FB team says that I "only need those permissions when I use a public-facing Login". Is that not the case?
Currently, my app only work when I connect with the account that created the app.
You do need those permissions, but if the App is for your client only you donĀ“t need to get them reviewed. Just add your client as Admin, Developer or Tester of your App and the permissions will work for him without review.

How do I grant my app permissions on pages or groups I created?

I have an app, and I can write to user's walls with it, having requested the publish_stream permission when they sign in.
I've also created a page and a group, and would like my app to be able to write to those. (Specifically, I want my back-end server to post some updates to those periodically, without a user being involved.) The ability to do this seems to be implied by the descriptions of the /feed parts of those here https://developers.facebook.com/docs/reference/api/page/ and here https://developers.facebook.com/docs/reference/api/group/ . However, I can't seem to find a way to authorize the app to write to these pages. Those docs say it can be done if you have publish_streams and manage_pages. OK, but how do I grant those to my app?
In the user case, you request those permissions when the user signs in via the OAuth flow. However, the page and the group never sign-in, so there's no way for them to grant the app permission. I looked around the settings pages for the group and the page, and couldn't find anything that will let me add the app. So how do I give the app the required permissions to post to the group and the page?
Found it!
http://developers.facebook.com/docs/reference/api/application/
http://developers.facebook.com/docs/howtos/login/login-as-page/
"Application Page Access Tokens
To perform the following operations as an Application Page, and not the current user, you must use the Application's Page access token, not the user access token commonly used for modifying Graph API objects nor the Application access token. This access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. This will return a list of Pages (including Application profile pages) to which the user has administrative access, along with an access_token for each Page.
Note: Applications that are configured as Native/Desktop apps will not be able to make API calls that require an application access_token."
So:
I went to http://developers.facebook.com/tools/explorer/ and, as me, created an access token with "manage_pages" permission.
I then went to https://graph.facebook.com/$myname/accounts?access_token=$accesstoken
and it gave me a list pages and apps that I had given permission to. I copied the access_token from the relevant page, and pasted that into my code, so that the server-side create event code always used that access token.
And it worked!

Page admins as admin of app?

I have a Facebook Application in order to manage comments on my web page, allowing for moderation, etc.
I also have a Facebook Page, for the same brand.
Is there anyway of having an Administrator list that is shared between these two objects? So that I can add and remove users from one and they would get/lose access to the other?
There's no way to do this automatically, but you can:
Have a trusted user (admin of the page and app) grant manage_pages permission to [your/an] app
Get the page access token for managing the page - see "Page Login" on this document
Retrieve a list of the other page admins from /PAGE_ID/admins
Use the App Access Token to add those users as developers/admins/etc of the App by posting to the Application's 'Roles' connection
Those users will receive (and must accept) a request to become an admin/developer/etc of the app
Caveat: the users you try to add to the app must be verified accounts (via SMS or credit card) or they can't be ad admin or developer of the app
I'm NOT sure about this, but I never saw such thing available. Probably you'll have to integrate an application to your page that works on this