O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Facebook authentication

These days, you don't always need to worry about creating user accounts; you can simply use an external service instead, and let the user connect their third-party or social account with your application.

Popular services such as Facebook, Google, and Twitter all provide an API to define and connect a new application. Focusing on Facebook, their services rely on OAuth for a token-based authorization system. OAuth is an open protocol for authentication and authorization; it allows you to use a third-party service to identify a user without directly accessing their credentials (password).

In this recipe, we'll be using Opauth to connect our CakePHP application with Facebook.

Getting ready

For this recipe, we'll need a table for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required