Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NetTuts.com:
Programming With Yii2: AuthClient Integration With Twitter, Google and Other Networks
Jun 26, 2015 @ 15:58:36

NetTuts.com has posted the latest part of their "Programming with Yii2" series today, this time with a focus on AuthClient integration allowing for easy interfacing with social services like Google or Twitter.

In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'll guide you through integration of the built-in AuthClient support to provide sign-in from third party networks such as Twitter, Google and Facebook.

For these examples, we'll continue to imagine we're building a framework for posting simple status updates, e.g. our own mini-Twitter, using our hello codebase. Use the GitHub links on this page to download the code repository. In Programming With Yii2: Integrating User Registration, I walked through integration of the Yii2-User library for user registration and authentication. In this tutorial, we'll learn how to integrate AuthClient with Yii2-User and override its views.

The tutorial starts off with a look at AuthClient: what it is, what it supports out of the box and which they'll be integrating (Google and Twitter). He shows you how to install the library via Composer and where to configure it, including the keys or secrets needed to connect to the provider of choice. For Twitter, he shows how to register a new "application" on their side and how to hook it into your own application and code. He advocates using an ".ini" file outside of the code to store the service credentials too. Finally he shows how to integrate it with the frontend, including the widget to override the default user login handling.

tagged: programming yii2 authclient twitter google social oauth

Link: http://code.tutsplus.com/tutorials/programming-with-yii2-authclient-integration-with-twitter-google-and-other-networks--cms-23489


Trending Topics: