Login With Google Using Codeigniter Framework Sample Code

Hello Developer welcome to free online projects.
Here this blog is all about how to login using google account with codeigniter and get sample code.
In other way we can say OAuth google using codeigniter framework. Its very simple and easy to implement.



Login With Google Using Codeigniter Framework Sample Code

I found many of people are searching the best method to get data from google by using OAuth.2.0 with codeigniter framework. So I wrote this blog to get things easily.before that we need to follow below steps.

Steps for Setting login using Google Account in codeigniter

Step – 1: Generate a Client ID and Client secret
Click below link and generate it.
https://console.developers.google.com
Step -2: Install codeigniter in your Xammp/htdocs folder
Step -3: In codeigniter folder You will find
Your_folder_name/application/third_party
Put this below srcFolder else download the sample code or project codes.
Step -4: Make a controller and Login view page as I have done. Download this code.



Possible Error

If you are running this code in localhost in window some SSL certification issues will come.

No worries. Simple Below Two step can solved.

Step -1: Download  caextract.pem file.



Put it in  C:\xampp\php

Step-2: Open php.ini file add below line

curl.cainfo="C:\xampp\php\cacert.pem"



Step-3: Restart Your Apache Server.

Download Sample Code

Download the source code

View Demo

View Demo



 

Advertisements