PlayerIO

The fastest way to build online games without breaking a sweat.

Facebook Authentication

If you don't have a Facebook Application, you will need to make one. Here are some external resources that can help you:

Control Panel Setup

You don't need to do any setup in the Control Panel other than creating a Connection that uses the Facebook authentication type.

You have the option of entering your Facebook App Id and App Secret in the setup, and if you do, PlayerIO will also validate that the given access token was issued for your Facebook App, and not a different Facebook App.

Authenticate

The thing you need to authenticate a Facebook user is their user access token. How to acquire this in your game depends completely on where your game is hosted, and what platform it is running on.

  • If you host your game on a Facebook canvas page, it should be available to your game there. If you use SiteBox, it will be automatically passed into your game as a flashVar.
  • If you are making a web game, you need to integrate the Facebook Javascript SDK and implement Facebook Login for the Web, which should result in a valid user access token.
  • If you are making a Flash we game, you need to implement the same solution as above, and you also need to bridge Flash and Javascript so that you can call the Facebook Javascript SDK from Flash.
  • If you are making a mobile game, Facebook requires that you integrate the appropriate mobile SDK, either iOS or Android, follow their guidelines for login, which should result in a valid user access token.
  • If you are making an Adobe AIR game for mobile, you need an ANE that wraps the Facebook mobile SDKs. We recommend this one from MyFlashLabs.

Once you have a Facebook access token for a user, you can call Authenticate like this: