Summary:
This article describes configuring an OAuth account to Google Pub/Sub in webMethods.io Integration Workflow.
Pre-requisites:
• User needs to have a Google account.
• Working webMethods.io Integration tenant.
Contents:
Section 1: Configure a Google OAuth account.
Section 2: Setting up a Google OAuth account in webMethods.io Integration tenant.
Section 1. Configure a Google OAuth account
-
Login to Google Console with the username and password.
-
From the projects list, select a project from the dropdown or create a new one if required.
-
To use Google Cloud API, the user must enable a Google Cloud Pub/Sub API for a project using console.
i. On the left, click on Navigation Menu.
ii. Under APIs & Services choose Library, select the API and enable it.
-
If the APIs & services page isn’t already open, open the console left side menu and select APIs & Services.
-
On the left, click Credentials.
-
Click + CREATE CREDENTIALS, then select OAuth client ID.
-
Users setting up Google Cloud Console for the first time, they need to configure the Consent Screen to get the Client ID click Configure Consent Screen.
-
In the next screen choose the user type as External click CREATE.
-
The Next screen will show for Edit app registration, provide the App name & User support email.
-
Provide the details for the Application home page & Authorized domains.
-
Provide the details for Developer contact information & click SAVE AND CONTINUE.
-
The Next screen will show for configuring the Scopes, click on ADD OR REMOVE SCOPES then select the API Check box & click UPDATE.
-
Click + ADD USERS to add some extra users for the app & click SAVE AND CONTINUE.
-
Review the Summary section, then click BACK TO DASHBOARD. Now we have successfully configured the Consent Screen.
-
Click +Create Credentials again & Select the appropriate application type (In this case application type is a web application) for your project and enter any additional information required.
-
Select Authorized to redirect URI’s and add the redirect URI as OAuth 2.0 Playground and hit Create.
-
Note down the Client Id and Client Secret created.
-
Open the browser and point the browser to Google Oauth Playground.
-
On the right corner of the page, click the gear icon and fill in OAuth Client ID and OAuth Client Secret generated (from Step 16), and click Close.
-
On the left side panel, select the scopes required.
-
Hit Authorize APIs.
-
Click Exchange authorization code for tokens.
-
Note down Access Token and Refresh Token.
Section 2: Setting up Google OAuth account in webMethods.io Integration Workflow
-
Login to webMethods.io Integration tenant and choose your project or click on “+” to create a new project.
-
Choose your workflow or click on “+” to create a new workflow.
-
From the right-hand panel of connectors list. Drag and drop a Google Cloud PubSub Connector.
-
Click on the gear icon on the connector and choose any predefined operation (Example: list topics) and click on “+” to add an account.
-
Fill in the Client Id, Client Secret obtained from Step 8 and Access Token, Refresh Token obtained from Step 22.
Refresh URL: https://www.googleapis.com/oauth2/v4/token
Grant_type: refresh_token -
Click Add and Hit Next and pass the required inputs (In this case list topics requires projectId to be passed).
-
Click Save and Run the workflow.