How to configure OAuth 2.0 in Mule 3 using HTTP Request 📣
We often need to implement OAuth 2.0 configuration in most of the Mule projects. During that scenario, we might need to send some extra parameters that are not available in Default OAuth2 - Client Credentials. In this article, I have covered how to send additional parameters in OAuth 2.0 implementation in Mule 3.
Consider we need to implement OAuth 2.0 client_credentials as grant_type in Mule 3 application. From the below screenshot it is clear that we cannot pass any additional parameters other than Client id and Client Secret while requesting Bearer token 🙅♂️.

Also read: How Global Error Handler works in Mule 4?

OAuth 2.0 Implementation in Mule 3 application
Step 1: Configuring Mule flow to pass all required parameters for token requests
Configure the flow as below to pass all the required parameters (client_id, client_secret, grant_type, and resource) to the Token URL (HTTP Request)

Step 2: HTTP Token Requestor Configuration 🔐
In this step, we need to configure the HTTP Request to send OAuth 2.0 parameters. As a response, we would get the access_token 🔑.
Step 3: Final HTTP RequestConfiguration 🔓
In this step, The access_token 🔑 extracted from the Step 2 response is sent to the resource provider using one more HTTP Request which actually provides us the required resource.
0 Comments