I have used example from this site.
I have just added the credentials and the line:
require_once APPPATH . "libraries/google-api-php-client-master/src/Google/autoload.php";
in the controller.
It gives the following error :
Fatal error: Uncaught exception 'Exception' with message 'This library must be installed via composer or by downloading the full package. See the instructions at https://github.com/google/google-api-php-client#installation.' in /var/www/html/gauth/application/libraries/google-api-php-client-master/src/Google/autoload.php:14 Stack trace: #0 /var/www/html/gauth/application/controllers/user_authentication.php(15): require_once() #1 [internal function]: User_Authentication->index() #2 /var/www/html/gauth/system/core/CodeIgniter.php(360): call_user_func_array(Array, Array) #3 /var/www/html/gauth/index.php(202): require_once('/var/www/html/g...') #4 {main} thrown in /var/www/html/gauth/application/libraries/google-api-php-client-master/src/Google/autoload.php on line 14
Please help, I am doing this for the first time!