A simple Sign In example using Google PHP API Client.
- Create a Google Developer account on Google Developer Console.
- Create an App on Google Developer Console - Create Project .
- Create an OAuth Client ID on Google Developer Console - Create Client ID .
- Install Google PHP API Client through composer.
composer install
- 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');
- Start your server from the root folder. For example:
php -S localhost:80
- Access the web page going to: Localhost.