How to restrict a Facebook group to authorized users?

144 views Asked by At

I'm developing a Web app that has a Facebook group associated with it. I want only authorized users of my app to be able to join this group, and I don't want them to have to be manually approved by a group admin.

My first thought was to use the game_group_join dialog from the JavaScript SDK, and display this dialog only to authorized users. But this seems to have a few problems; no way to keep track of which Facebook accounts are associated with which accounts in my app, doesn't work with JavaScript disabled, there seems to be no way to stop an unauthorized user from joining the group by making the underlying HTTP requests to Facebook themselves, etc. A server-side solution would seem to eliminate these problems, but I'm not sure if there is one for Facebook app groups.

Can anyone offer advice on how I should be handling this?

2

There are 2 answers

0
Tiep Doan On

Taymon, here is the solution I think would fit in your case:

-Have the user login to your app with public_profile permission. From here you can capture the user's app_scope_id

-Check if the user is allowed to join the group, display Javascript dialog 'game_group_join' and invite the user to join.

- You have to link existing users with their Facebook app_scope_id after they login/connect with Facebook.

0
anmari On

Tayman, Your first thought is pretty much the way and yes there is a server side solution (with app id and app secret).

You'd have to record something when they do the join dialog or you check if the logged in user is a member of your app group and record it's app-scoped userid in it's website user record.

In summary: use the app (php?) to create a closed group.

https://developers.facebook.com/docs/graph-api/reference/v2.3/app/groups#publish

Users can only join the group through the app, they cannot request to join just from inside fb. Here is a test group I've been playing with: https://www.facebook.com/groups/879916105406758/

you can do much with js, however the "add me to the group" has to be done with the javascript join dialog.
https://developers.facebook.com/docs/games/app-game-groups#join

Facebook only allows php 'joins' for test users, not for normal facebook users. https://developers.facebook.com/docs/graph-api/reference/v2.3/group/members/

Once a user has authorised you, you can check which groups they belong to and record their app-scoped user id with your website user record.