webMethods.io Integration Secure orchestration using OAuth 2.0
Tags: tutorial, integration, authentication, oauth
Published: 2021-08-06 13:42:23

---
title: webMethods.io Integration Secure orchestration using OAuth 2.0
published: true
date: 2021-05-21 08:13:30 UTC
tags: #tutorial, #integration, #authentication, #oauth
canonical_url: https://tech.forums.softwareag.com/t/webmethods-io-integration-secure-orchestration-using-oauth-2-0/241533
---

## [webMethods.io](http://webmethods.io) Integration Secure orchestration using OAuth 2.0

### Introduction

This article explains about implementing the OAuth2.0 authentication on the [webmthods.io](http://webmthods.io) integration flow service and workflow.

### Audience

It is assumed that readers of this article know how to create integrations on [webMethods.io](http://webmethods.io).

### Prerequisite

1. Subscription for [webMethods.io](http://webmethods.io) integration tenants
2. Sample workflow or flow service is already developed.
3. Sample flow service or workflow is wrapped using API

### Use Case

1. We have created the webhook workflow
2. Same workflow is wrapped under API and exposed to the outer world with new endpoints
3. In our case we will implement the OAuth 2.0 mechanism on the API.
4. When third-party application wants to access it, OAuth 2.0 mechanism will be used to authorization purpose.

**What is OAuth2.0?**

- OAuth is an [open standard](https://en.wikipedia.org/wiki/Open_standard) for access [delegation](https://en.wikipedia.org/wiki/Delegation_(computer_security)), commonly used as a way for Internet users to grant websites or applications access to their information on other websites but without giving them the passwords
- For more information, you can follow below link
  - [**https://oauth.net/articles/authentication/**](https://oauth.net/articles/authentication/)

## Steps to implement OAuth 2.0

### Create OAuth Client

1. Login to [Webmethods.io](http://Webmethods.io) integration and from user icon from the right click on settings.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/0/e093ab08965098e76f1207c1159353404164cd27.png)
2. Click on OAuth2.0
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/9/e905d39c0612c6c3a907803ab77a875fad72d848.png)
3. From the Client registration tab click on Add new Client
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/e/6e6b816ddac64ef8b3df53572fd768fee9cdc96a.png)
4. Provide the name for Client as CustomerRegistrationOAuthClient
5. Under the client management provide the version, Type as “public”
6. In our case we are going to submit the request using the postman client so redirection url will be [https://oauth.pstmn.io/v1/callback](https://oauth.pstmn.io/v1/callback)
7. Set Allowed grants as “Authorization Code Grant”
8. Set Expiration interval as “Never Expires”
9. Set refresh token as “Unlimited”
10. Click Add.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/5/c589a03c5b601ecdb964980a0ebebae913c30fd0.png)
11. Now with this our OAuth client is ready.

**Create Scope**

1. Click on Add New Scope
2. Provide the name for the scope as CustomerRegistrationScope.
3. Select the project and select the appropriate API from the option provided.
4. In our case we want to select the CustomerRegistrationAPI and select the resource
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/3/f/3ffa323152532cc7c175fdad12c1ed1cbd624df4.png)
5. Click on Add.

**Associate Scope with OAuth Client**

1. Click on Client Registration
2. Click on existing associate scope under the action
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/2/725420d6755d640e688db008df660bf3dbfb356a.png)
3. Click on Add existing scope
4. Select the scope created “CustomerRegistrationScope”
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/3/5/35fc646ade37f348c148062e119239384a990211.png)
5. With this we have completed the OAuth setup in [Webmethods.io](http://Webmethods.io) integration.

**Testing with postman**

1. Gather the below information to invoke the request from postman  
a. Client ID  
b. Client Secret  
c. API endpoints  
d. Call back url  
e. Authorization URl
2. We can get the above details from CustomerRegistrationOAuthClient
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/5/c589a03c5b601ecdb964980a0ebebae913c30fd0.png)
3. Get the access token
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/d/ad0827068c586cf27353ede0c2536963be4e3673.png)
4. Click on Get Access token.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/b/cb5b574bb645c955b665a90f928f4adbe09051e1.png)
5. Provide the grant access
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/0/70cb0a2e56cc22509de80402a73213c409d6f4d2.png)
6. Access token is generated.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/2/a22600dc50d921bb1ebfd5e26acc5f75a648d2e8.png)
7. Now use this token to send the request and get the response from API
8. Trigger the request and you will get the response from your API which get authenticated with token passed .

[Read full topic](https://tech.forums.softwareag.com/t/webmethods-io-integration-secure-orchestration-using-oauth-2-0/241533)