The Facebook realm takes responsibility for authenticating users who access the host app using their personal Facebook account.
The logic for this realm is located at grails.plugins.nimble.core.FacebookRealm for authentication purposes the important method is authenticate.
This realm operates on the token type grails.plugins.nimble.core.FacebookToken which is generated by the AuthController once the user has selected the Facebook authentication method and the Facebook Connect servers have responded with appropriate account details.
When registering for Facebook connect you will need to specify a value for Connect URL under the connect tab in the Facebook registration page. Set this to http://<hostname>/nimble/auth/facebook e.g. For testing we use http://localhost:8080/nimble/auth/facebook. To just make use of connect a lot of the other values are largely irrelevant, though if your application needs more integration with the Facebook application you may wish to specify those details. For the Facebook realm to function currently both nimble.facebook.apikey and nimble.facebook.secretkey configuration options must be populated with the values advised by Facebook when you registered for Facebook Connect. For the Facebook realm the authentication process is:
If all the above is valid a session is established for the user and they are allowed to continue. Failure at any stage results in an appropriate exception being thrown.
|