Authenticating Wonderland against Facebook

(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.

  1. 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.
  2. Read Jon’s instructions to add different authentication mechanisms.
  3. Download the Facebook Authentication module from the module warehouse, and deploy it to the wonderland server.
  4. Close down the Wonderland web server completely.
  5. 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.
  6. 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.
  7. 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.

About these ads

3 Responses to Authenticating Wonderland against Facebook

  1. Sedo Keita says:

    Dear ,

    I need more details about step 5 ?
    and what is the plugin configuration file ?
    and where can i save it on the .wonderland-server directory ?

    thanks

    Sedo

  2. Bernard says:

    oh, just to clarify (or possibly further muddy the waters)–you need to download the configuration file from the blog posting, NOT use the one in Jon’s tutorial.

    Bernard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 56 other followers

%d bloggers like this: