Follow the procedure below to register an app and obtain the OAuthClientId and OAuthClientSecret.
Create a Custom OAuth App: Web Apps
Follow the steps below to obtain the OAuthClientId and OAuthClientSecret.
- Log into the Google API Console.
- Click Create Project or select an existing project.
- In the API Manager, click Credentials -> Create Credentials -> OAuth Client Id.
- Select the web application type. In the Authorized Redirect URIs box, enter the URL you want to be used as a trusted redirect URL, where the user will return with the token that verifies that they have granted your app access.
- Click Create. The OAuthClientId and OAuthClientSecret are displayed.
- Click Library -> Gmail API -> Enable API.
Create a Custom OAuth App: Service Account
Follow the steps below to create an OAuth application and create a private key:
- Log into the Google API Console.
- Click Create Project or select an existing project.
- In the API Manager, click Credentials -> Create Credentials -> Service Account Key. In the Service Account menu, select New Service Account or select an existing service account. In the Key Type section, select the P12 key type.
- Click Create. The key pair is downloaded and the private key's password is displayed.
- Click Library -> Gmail API -> Enable API.