Facebook Integration - Authentication

Sooner or later, you're going to want to identify the user of your app. Traditionally, this has required the user to create and maintain (yet another) user ID and password. In fact, this became such a nuisance, users would generally avoid it like the plague.

Fortunately for us, the folks at Facebook created a mechanism that allows people to use their facebook credentials for authentication at additional sites. Furthermore, this approach has become quite popular - sites such as Spotify and I Heart Radio provide users with the ability to authenticate themselves with either a traditional user ID / password, or via their Facebook credentials.

The team at Facebook has created a fairly simple process for performing this integration. Unfortunately, the instructions for iOS and Android developers differ, so one solution doesn't necessarily match the other. In this section, I'll close the gap between the two approaches and demonstrate how to authenticate users via their Facebook credentials. In future sections, we'll use this data on the server to verify that a request comes from a legitimate user.