views:

206

answers:

1

I'm building a website and I want it to integrate with Facebook Connect. The one problem I have is that I want to restrict the users connecting to only those who are part of a specific Facebook group or let them connect and have an admin approve their account. Is this possible?

+1  A: 

This should be quite achievable.

Present an entry page on your site that requires the user to log in with Facebook Connect. (See "Authenticating Users with Facebook Connect"). Once they're logged in, you will be provided with a Facebook session id specific to that user. You can use that session id to query for user information, either inside the page with the Javascript API libraries, or server side (see "Using Facebook Connect with Server Side Libraries").

One of the API calls is groups.get, which will return the groups that the user is in. You should be able to retrieve the user's associated groups after they've logged in to Connect, and as part of your page load process check to see if they're in the right group. If they're not, simply re-direct them appropriately.

zombat
Thats great, thanks!