Skip to content

Get your google sign in in 10 minutes or less with this script. Also includes logging out. php google sign in

License

Notifications You must be signed in to change notification settings

soljohnston777/fast-and-easy-php-google-sign-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google PHP API Client Examples

A simple Sign In example using Google PHP API Client.

Create a Folder in your htdocs or www folder:

sign_in

Copy all the files there:

client_secrets.json composer.json composer.lock google.php

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 . 3.1 Select - Web Application 3.2 Put in your Authorized redirect URIs as:

    http://localhost/sign_in/google.php https://localhost/sign_in/google.php

3.3 Download this file when creating your Credential:

client_secrets.json
  1. Install Google PHP API Client through composer. go to the Go to your htdocs or www folder then to the folder: cd sign_in/
composer install
  1. Put in your App's CLIENT_ID and CLIENT_SECRET (and project_id) in the file if you didn't download it

    client_secrets.json

{"web":{"client_id":"client_id.apps.googleusercontent.com", "project_id":"login-123456", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "token_uri":"https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", "client_secret":"client_secret", "redirect_uris":["http://localhost/sign_in/google.php"]}}

  1. Start your PHP server if it isn't already running.

  2. Access the web page going to: http://localhost/sign_in/google.php

About

Get your google sign in in 10 minutes or less with this script. Also includes logging out. php google sign in

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages