Search code examples
facebookfacebook-permissions

Am I allowed to create an app that only invited people can join?


Am I allowed to create an app that only invited people can join?

Or do all apps have to be open to everyone?


Solution

  • You can have a white list for people who are allowed to use your app in your database and ignore any request for other people.

    EDIT:

    As per the question in the comment section, I will give you more details. I have not quite done exactly this, but I can guarantee you this is possible. I have a website, linked to Facebook and people can log in to the site using Facebook. In my database I am storing the Facebook ID and the Facebook user access token. When a user clicks on the login with Facebook, his Facebook user access token is checked against the database. If the Facebook user access token (which works like a temporary password) expires, it is renewed. However, people are identified by their Facebook ID. I could easily have a white list for Facebook IDs and allow access only for people whose Facebook ID can be found in the database. My project strategy is to get as many users as possible, but I could easily modify this to restrict access for not verified people. Your problem with consistent login probably lies in the fact that the Facebook user access token expires in a few hours. However, that problem is solvable:

    • if the user has modified his Facebook password, or has not connected to the app, then he will be asked by Facebook for permissions
    • if the user is no longer logged in, then he will have to log in
    • if the user's Facebook user access token has expired, then you should generate a new Facebook user access token
    • finally, you can generate long-term Facebook user access tokens, which last for months.

    Read the documentation for details, but keep in mind that things might have been changed at Facebook since the documentation was written, therefore you should not believe everything written there, but should rather test the validity of the most important statements.