OAuth is a powerful and easy to use authentication system that allows a user to sign into a website through the credentials of a third-party site. This reduces the burden of needing to remember passwords and it can be more convenient as well by allowing sign in with a single click. In this recipe, we will create a system that allows automatic account creation and sign in through a user's Google account.
This recipe uses Phalcon Developer Tools for creating a project skeleton and Composer for installing third-party libraries. Additionally, since this recipe uses Google as the authentication service, we will need to create and configure a Google account for use with the OAuth.
This recipe has a very delicate setup due to the conditions of the Google OAuth API.
This recipe requires the PHP curl extension to be installed.