AdrianCabrera / Google-PHP-API-Client-SignIn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google PHP API Client Examples

A simple Sign In example using Google PHP API Client.

Steps

  1. Create a Google Developer account on Google Developer Console.
  2. Create an App on Google Developer Console - Create Project .
  3. Create an OAuth Client ID on Google Developer Console - Create Client ID .
  4. Install Google PHP API Client through composer.
composer install
  1. Use your App's CLIENT_ID and CLIENT_SECRET on the file app/classes/GoogleAuth.php.
$this->client->setClientId('CLIENT_ID');
$this->client->setClientSecret('CLIENT_SECRET');
$this->client->setRedirectUri('http://localhost');
$this->client->setScopes('email');
  1. Start your server from the root folder. For example:
php -S localhost:80
  1. Access the web page going to: Localhost.

About


Languages

Language:PHP 100.0%