How to create OAuth client ID and client secret for Google APIs


Step 1: log into your Google account then go to the website: https://console.developers.google.com/projectselector/apis/credentials

google api 1

Step 2: Click on the blue button “Create a project”.

google api 2

Step 3: click on the button “CREATE”. Wait a few seconds then you see the screen:

google api 3

Click on the blue button “Create credentials”, you will see 4 options to choose.

google api 4

Step 4: Click on the option: “OAuth client ID”, now you will see the screen:

google api 5

Click on the blue button “Configure consent screen”, then fill the field: “Product name shown to users”

google api 6

Now, click on the button Save at bottom of this page.

Step 5: Select Application type

Select “Web application”, then fill the field name (you can use the default value of this field). You can use some Authorized JavaScript origins and some Authorized redirect URIs.

google api 7

Step 6: Click on the button Create, you can see your client ID and your client secret

google api 8

Done, now you can use these informations to configure your code.

You can go to Google library to enabled your api you need like Google Drive API
google api 9

Leave a Reply