You will have noticed that many websites provide an option to log in to their own site using third-party authentications such as Facebook, Google, Twitter, LinkedIn, and so on. This has been made possible by OAuth 2, which is an open standard for authorization. It allows the client site to use an access token to access the protected information and resources provided by the resource server. In this recipe, we will show you how to implement OAuth-based authorization via Facebook. In later recipes, we will do the same using other providers.
Using Facebook for authentication
Getting started
OAuth 2 only works with SSL, so the application should run with HTTPS. To do this on a local machine, please follow these steps:
- Install...