Google Cloud Storage OAuth 2.0 Authentication in webMethods.io
Tags: integration, google, cloud, storage
Published: 2021-05-27 08:16:11

---
title: Google Cloud Storage OAuth 2.0 Authentication in webMethods.io
published: true
date: 2021-04-21 13:32:41 UTC
tags: #integration, #google, #cloud, #storage
canonical_url: https://tech.forums.softwareag.com/t/google-cloud-storage-oauth-2-0-authentication-in-webmethods-io/240725/1
---

## Summary:

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](http://webMethods.io).

## Prerequisites:

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.

## Contents:

- How to generate an Access token for the Google Cloud Storage API for the OAuth 2.0 Authentication.

> **Note:**  
> 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.

## Steps:

1. Log in to the Google cloud console([https://console.cloud.google.com](https://console.cloud.google.com/) ), with the Google credentials. It will look like below.
![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/e/ea488946aa5408734e11cb568f4bd9a6d2c0bda5.png "image")
1. Users can create a new project or existing projects can be used. In this case, the existing project has been used.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/6/6262914d9ebb744bcb1d0c29190ac684fa3f054b_2_690x178.png)
1. 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.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/b/b0dbc79f7d745d0e09ee49a8301089dcc0f11636_2_690x358.png)
1. The dashboard will appear for APIs & Services. Now click on the “ENABLE APIS AND SERVICES”.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/e/e6bbf71ece55ce1fb2f9cab346980fa8a1dee093_2_690x302.png)
1. 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.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/5/56dc3f3a0962eea13d1bab878b98186e7a68ce2b_2_690x404.png)
1. 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.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/3/3/334f2d0ce79e68e8f9777c12211eea4d6575c185_2_690x404.png)
1. Once the APIs are enabled successfully, It looks like the below screenshot.
![GCS2](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/2/b/2b0a9ee2316f1a0ef36629900d9469331222060d_2_690x259.png)
1. 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.
2. 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”.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/f/f0f1879fdd61535ba3293746758621307a9de11b_2_690x328.png)
1. 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](https://developers.google.com/oauthplayground/) and click on the “create” button.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/9/9b3260bd7941df16599f8b3327bae2f023154f78_2_690x445.png)
1. 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.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/b/b631eb2301687c1b5196e01021ab7f87436f4477_2_690x345.png)
1. 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](https://developers.google.com/oauthplayground/)
![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/0/0130ad5d40e9fb38ba64458688b1664f38712f70.png)
1. Now, search for the Google Cloud Storage API and click on their respective scopes and click on the “Authorize” button.
![GCS3](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/d/a/daae9f23b9771abc446595b41b722631e63f6a18_2_501x500.png)
1. Next page will ask for granting the permission for the scopes, click on the “Allow” button.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/2/21cf602ff3caed648c07faff70a16b6523e613d7_2_690x484.png)
1. 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.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/f/fb25f4758c318d09857a1fe0fa7161582308e6c3_2_690x276.png)
1. Now, the user can use these “access\_token” & “refresh\_token” in [webMethods.io](http://webMethods.io) integration cloud tenant to make a connection for the Google Cloud Storage connector. Now log into the [webMethods.io](http://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.
![GCS4](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/8/b/8bfcc43b1aff529e3badcfac26c07a257fa1127a_2_690x290.png)
1. Choose the action from the predefined operation drop-down menu and click on the “+” sign to configure the new connection.
![GCS5](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/a/5/a556a4195875332cf73ce1af02701e5b00702b35_2_690x377.png)
1. Fill in all the necessary credentials details and click on the Save button.
![GCS6](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/a/0/a06a2568ebb6f86d2ff6b52724410dadd3027945_2_690x378.png)
![GCS8](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/3/e3ec0349fa696c0312989d1a89b21d4f274d1605.png)
1. 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.
![GCS9](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/a/9/a9d88db9b4c97a5067500539944061789f9719a4_2_690x396.png)

[Read full topic](https://tech.forums.softwareag.com/t/google-cloud-storage-oauth-2-0-authentication-in-webmethods-io/240725/1)