This code is very simple with one PHP file. All other things happen with google API.
you can get these Google APIs Client Library for PHP here and you can download the code from here

Google Login Process:

You just need to change google seting like client ID and Secret ID and Developer ID. To get these ID please click here. (Create Google OAuth API and Developer Key).
Just change these setting as well as your Mysql database setting.

When user clicks on login button. He is redirected to google Authentication page. Now User need to grant permission, when user grant permission, he is redirected back to your site with Access Token. By using this token you can get all detial of that user. You can store these detail for further use.


echo ‘‘;