Book Image

Yii Project Blueprints

By : Charles R. Portwood ll
Book Image

Yii Project Blueprints

By: Charles R. Portwood ll

Overview of this book

Table of Contents (15 chapters)
Yii Project Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Social authentication with HybridAuth


In the previous chapter, Chapter 5, Creating a Microblogging Platform, we used HybridAuth to sign in as a user to, and share content with, Twitter. In this chapter, we use HybridAuth to register accounts in our CMS and to sign in to our CMS without having to enter a username and password. To achieve this, we'll create three new forms, a new UserIdentity class, and a control that will enable us to take advantage of all the providers that HybridAuth has to offer.

Before we get started with any coding, however, we need to first create a new Twitter application similar to the one we created in Chapter 5, Creating a Microblogging Platform. This will allow us to focus on development rather than configuration once we start writing code. Once your Twitter application has been created and permissions have been set, add a hybridauth section to your protected/config/params.php file, containing your OAuth secret token and key:

'hybridauth' => array(
   'providers...