How to get a set of OAuth 2.0 Credentials on Google

To get a set of OAuth 2.0 credentials – Client ID and Client Secret – on Google, visit the Google API Console. You may be asked to sign in to your Gmail Account.

Create or choose a “Project”

If this is the first time you’ve accessed this screen, select Create a project and click Continue.

(If you’ve visited here before, you might find a previous project under the “Select a project” dropdown list, in which case, go ahead and select a previous project to use.)

gmail api for wordpress smtp plugin

On the next screen, click Go to credentials.

api credentials

Create Credential Type

Under heading Credential Type, make sure to answer the question Which API are you using by setting the selector underneath it to Gmail API. For question What data will you be accessing,Select User data.

Click NEXT.

google api credentials type

On the next screen, provide the following information:

  • App Name – This is a free-form text field. Insert something like Gmail for WP.
  • User Support Email – Enter your email address. 
  • Developer Email Address – Enter your email address. 

Click SAVE AND CONTINUE.

app information

Skip the next step, Scopes, as it’s optional.

For item 4, OAuth Client ID, select Web application as the Application Type.

auth application type

Scroll down the screen and click ADD URI. For both Authorized JavaScript Origins URI and Authorized Redirect URI, insert the address of your WordPress website, like https://mylovelyshop.com.

Click Create.

adding authorized uri

You should now be presented with a link to your credentials page. Click the credentials page link.

auth credentials

You’re done: collect your credentials

Copy the Client ID and Client Secret and keep them available for the next step.

Note: You can always come back to the Credentials screen to find these credentials. They do not get deleted.