episyche logo


NextJS/Single Sign On(SSO)/Google/

How to create OAuth Client Id and Client Secret for Google?

Published on

How to create OAuth Client Id and Client Secret for Google?
The Client ID is a public identifier of your application. The Client Secret is confidential and should only be used to authenticate your application and make requests to Google APIs. This article shows how to create a google client Id and client secret.

Please follow the below steps to get the Google App Client Id and Client Secret.

1. Log in to Google Developer Console using your Google account credentials.

2. If you are not registered on a Google developer account, then you need to accept the agreement


3. After accepting the agreement or if you are already registered on a Google developer account, you will see a screen as shown below. Click on “Select a project” on the top header bar.


4. From the project selection popup click on the "NEW PROJECT" button to add a new project.


5. Enter your “Project name” and click on the “Create” button. You can also edit Project ID if you want to.


6. On the Credentials page, select the Configure consent screen.


7. On the “OAuth consent screen”, Choose User Type as per your requirement and click on Create button to process further.


8. Add the Application name, select Support email, and add Authorized domain and Developer Content Information. Then click on the Save and Continue buttons.


9. After completing all 3 steps in the OAuth Content screen, click on Back to Dashboard on Summary Step.



10. After creating the project, click on “Credentials” from the left side menu to open the credentials screen Click on “Create credentials” and from the dropdown list select OAuth client ID.


11. On OAuth client id creation screen:

  • Select the “Web Application” from the “Application Type” dropdown.

  • Enter your OAuth 2.0 client name in the “Name” field.

  • Enter your website URL in “Authorized JavaScript origins”. In my case, its “https://episyche.com

  • In the “Authorized redirect URIs” input box, enter the authorized redirect URIs of your website. In my case, it's “https://episyche.com/api/auth/callback/google”.

  • Click on the “Create” Button.


12. Following popup will display the client id and client secret.