The article guides you to create an OAuth2 Authentication application so that you can get a Client ID and Client secret Google, help you get authentication keys, add Google login to your website or configure SMTP to send mail with Gmail.
App OAuth2 Authentication – How to get Client ID and Client secret Google
Step 1. Login and verify your account
To be able to create Client ID and Client secret, you must first sign in to your Google account. Open the Google Developers Console. If you’re logging in and using it for the first time you’ll have to do some verification from Google, just follow what’s shown on the screen once you’ve signed in.
Step 2. Create Project and authenticate
Once logged in, look at the blue menu bar at the top and click New Project, give the project a name and click Create to create a new one. The message line you will get “Remember to configure the OAuth consent screen with information about your application.” then click on OAuth consent screen to configure.
- User Type: to get Client ID and Client secret Google for individuals, select External and click Create or Internal for company
- App information: You can name the app, contact email address, and logo.
- Authorized domains: Enter your domain name or the name of the application that will use a Client ID and Client secret.
- Developer contact information: Enter your contact email and click Save and continue.
- Leave the Scopes, Optional info, Summary tab blank and click Save and continue
Step 3. Create Client ID and Client secret Google
Next, in the left menu and click on Credentials and then click on “+ Create credentials” then select “OAuth client ID” to start creating a new Project as shown below.
- Application type: Select web application
- Name the application.
- Authorized redirect URIs: Enter the URL of the application you will use Client ID and Client secret. For example, here I use to configure SMTP to send email to WordPress with WP Mail SMTP plugin, so my URL is: https://connect.wpmailsmtp.com/google/.
- Finally, click Save you will get Client ID and Client secret Google displayed on the screen. You can also change the application’s information by clicking on the edit actions icon.
Above are the steps to create a Project and how to get a Client ID and Client secret from Google for the OAuth2 Authentication application. If you have any questions, please leave a comment below.