Skip to content

authentication facebook

harmenjanssen edited this page Dec 31, 2014 · 1 revision

Facebook authentication

An elaborate configuration (note that only class, appId, secret and mapping are required):

Configuration basics: this is the classname suffix of this adapter, should always be 'Facebook'.

auth.adapters.facebook.class = "Facebook"

Facebook app configuration: these credentials can be found on Facebook.

auth.adapters.facebook.appId = "332681197475"
auth.adapters.facebook.secret = "6bcba24a51f01b306bf4178b0bcb6f"

Mapping configuration, this maps Facebook OG data columns to our own database columns Note that the part between brackets is the column name on the Facebook side, the part after that, = "name", is the column name in our own database.

auth.adapters.facebook.mapping[name] = "name"
auth.adapters.facebook.mapping[email] = "email"
auth.adapters.facebook.mapping[imageUrl] = "imageUrl"

Scope is used to determine the level of info you're asking of your users. This defaults to the most basic level. (see also https://developers.facebook.com/docs/facebook-login/permissions/v2.2)

auth.adapters.facebook.scope = "email"

Wether to save the user's image:

auth.adapters.facebook.grabUserImage = true

Garp can automatically pull Facebook friends and sync them with our local User table. Simply configure the following lines and watch the magic happen:

auth.adapters.facebook.friends.collect = true
auth.adapters.facebook.friends.bindingModel = Model_UserUser

For this to work make sure to spawn the AuthFacebook model. A sample json can be found in the Garp folder.

Clone this wiki locally