(This blog posting describes how to install and use the Facebook Authentication module.)
Many developers already know that Wonderland supports three modes of authentication:
- no authentication (the default);
- “full” authentication (in which users must have a valid account);
- and “optional” authentication (which allows guest users, but provides authenticated users with privileged access).
The module required to enable authentication is available on the module warehouse and the steps required to install it in Wonderland are clearly laid out in Jon Kaplan’s excellent tutorial. In addition, Jon’s tutorial includes a description of extending the authentication mechanism by using the LDAP authentication module, also available from the module warehouse. As always, the source code for these modules is available from the Open Wonderland modules workspace.
Readers of my earlier posts will be aware that I’ve been exploring how to integrate Wonderland with the wider web, including web-based social networking services such as Twitter. The 1000lb gorilla of social networking services is, of course, Facebook. For example, more than 25 million Britons, or one in three of the entire population, is now a member of Facebook. Given that so many of us have an account with Facebook, it appears to be becoming a common authentication service for many other applications via its Facebook Connect APIs. The obvious next step, then, is to extend Wonderland so that users can log in using their Facebook credentials. In the remainder of this blog posting, I’ll take you through the process to enable Facebook authentication for your Wonderland installation.
- Firstly, download and install the authentication module from the module warehouse, taking care to follow the instructions in Jon’s tutorial. Do not try to move on to the next step until you can demonstrate that authentication works for your installation.
- Read Jon’s instructions to add different authentication mechanisms.
- Download the Facebook Authentication module from the module warehouse, and deploy it to the wonderland server.
- Close down the Wonderland web server completely.
- The Facebook authentication module acts as a user plugin in a similar fashion to the LDAP plugin, and needs to be configured. Download an example plugin configuration file that includes using the Facebook authentication module and save it in your .wonderland-server directory.
- Now you just need to tell the Wonderland web server to use the configuration file. You do this by adding an entry to the my.run.properties file, as described in Jon’s tutorial.
- Now restart Wonderland and you should be able to login using your Facebook email address and Facebook password.
For an example of this in action, see the video below.
Facebook isn’t the only third-party authentication service that Wonderland could use. Google provides an authentication API that looks like it could be incorporated into Wonderland’s login mechanism, but I’ll leave that as an exercise for the reader!
The source for the module is available from the positive-spaces SVN repository, described in my last post: Wonderland a Twitter.