This article describes the step-by-step process of generating an Access token for the Google Cloud Storage OAuth 2.0 Authentication for the webMethods.io.
User needs to have a working Google account, to log into the google cloud console. Sometimes it’s required paid tenant depending on the charges applicable on the API.
- How to generate an Access token for the Google Cloud Storage API for the OAuth 2.0 Authentication.
Any coding or configuration examples provided in this document are only examples and are not intended for use in a production system without verification. The example is only done here to better explain and visualize the possibilities.
- Log in to the Google cloud console(https://console.cloud.google.com ), with the Google credentials. It will look like below.
- Users can create a new project or existing projects can be used. In this case, the existing project has been used.
- Now enable the Google Cloud Storage API for the newly created project or in an existing project. So, click on 3 bars → APIs & Services → Dashboard.
- The dashboard will appear for APIs & Services. Now click on the “ENABLE APIS AND SERVICES”.
- It will take the user to the “API Library”. A search bar will appear, users need to search for the particular API’s, that he needs to activate for this project.
- Let’s enable Google Cloud Storage and we will generate the access token for the same. Search for the Google Cloud Storage API. select and enable It.
- Once the APIs are enabled successfully, It looks like the below screenshot.
- Now the Google Cloud Storage API is enabled successfully for the selected project. Now we will proceed for obtaining the Access token for the Google Cloud Storage OAuth 2.0 Authentication.
- To generate the OAuth 2.0 Access_token for any google cloud storage APIs, the user needs to generate the “client_id” & “client_secrets” first. Navigate to the “API & Services” and click on the “Credentials”. On the page choose the “Create Credentials” dropdown and select the “OAuth client ID”.
- The next page is asking for the details of “Create OAuth client ID”, choose the “WebApplication” under the Application type and provide the Name of the Application (any name). provide the redirect URI: OAuth 2.0 Playground and click on the “create” button.
- The next page contains information about the “client_id” & “client_secret”. Note down these details as we need these credentials for the generation of the Access_token.
- Now, we have generated all the necessary credentials for the OAuth 2.0 Authentication from google cloud console. Now we will navigate to Google’s “OAuth 2.0 Playground”. Link: OAuth 2.0 Playground
- Now, search for the Google Cloud Storage API and click on their respective scopes and click on the “Authorize” button.
- Next page will ask for granting the permission for the scopes, click on the “Allow” button.
- It will redirect you again in the “OAuth 2.0 playground” page. Now click on the “Exchange authorization code for tokens” and it will give you the “access_token” as well as the “refresh_token”. The validity of these tokens is around “3600 seconds” i.e- Approximately 1 hour.
- Now, the user can use these “access_token” & “refresh_token” in webMethods.io integration cloud tenant to make a connection for the Google Cloud Storage connector. Now log into the webMethods.io tenant and create a workflow. Inside the workflow drag the Google Cloud Storage app from the menu and click on the “setting” button.
- Choose the action from the predefined operation drop-down menu and click on the “+” sign to configure the new connection.
- Fill in all the necessary credentials details and click on the Save button.
- Now, save this connection and let do the dry run while running one operation “listBuckets”. So the integration runs successfully, below is the graphical view for the same.