Skip to main content
CakeDC Blog

Create Google app for web oauth2 login step by step

Here's a step by step tutorial about how to create a web oauth2 app in Google dashboard.

Google app oauth login app 1

  • Add some cool name for your new Google app project and click "Create"

Google app oauth login app 2

  • Under "Library" section, create a new Google+ API project

Google app oauth login app 3

  • Click "Enable" in the dashboard tab

Google app oauth login app 4

  • Under "Credentials" menu, click "Oauth consent screen" tab and enter some cool name to be displayed to users when requesting their access to your application. Then click "Save".

Google app oauth login app 5

  • Under "Credentials" menu, click "Create credentials" and select "Oauth client ID".

Google app oauth login app 6

  • Now click "Web application" radio, and type your domain name and oauth callback
    • Under "Authorized Javascript origins", add your domain name: mydomain.com
    • Under "Authorized redirect URIs", add all the allowed callback url's to your application. For example if you are using CakeDC/Users Plugin, you'll need to add mydomain.com/auth/google
  • Then click "Save"

Google app oauth login app 7

  • Copy the Iauth client and secret id's into your application configuration
  • Be careful, some browsers will append blank spaces to the codes, remove any extra blank space (trim)

Google app oauth login app 8

  • Ensure the API is enabled, you can test your application now and check there is "Traffic" displayed

 

You have now a Google app configured to provide Oauth2 login to your web application. Enjoy!

 

 

 

 

 

 

 

 

 

Back to all articles
We Bake with CakePHP