Open Authorization (known normally by its shortened name, OAuth) is an open standard developed for authorization, which allows a user to share private data stored on one site or device (e.g. your mobile phone) with another site. Instead of using credentials such as a username and password, OAuth relies on tokens instead. Each token has encoded within in it a series of details for a specific site (e.g. FourSquare or Twitter), using specific resources or permissions (for example, photos or your personal information) for a specific duration of time (for example, two hours).
FourSquare is a popular location-based social networking site specifically made for GPS-enabled mobile devices. It allows you to check-in to various locations, and in doing so, earn points and rewards in the form of "badges". In this recipe, we will use OAuth to connect to FourSquare and retrieve an access token that we can use later on to enable our application to "check-in" to various...