Posts

Showing posts from May, 2023

Securing API with Salesforce as OAuth Provider on Anypoint Platform

Image
This document covers steps for securing an API with Salesforce as OAuth 2.0 Provider on Anypoint Platform. We'll create a Connected App on Salesforce account for this demo. Then on the Anypoint Platform we will setup Salesforce as a Client Provider of type - OpenID Connect Dynamic Client Registration. Next, we'll configure default Client provider in the environment where our API lives. After that, we will deploy our API to Cloudhub and then secure it using OpenId Connect access token enforcement Policy. Let’s begin... Pre-requisites Salesforce Account Mulesoft Anypoint Platform Account API ready for Cloudhub Deployment For this demo, we're using the following Non-MuleAPI - Coffee SampleAPI RAML File -  Link . You can import it in Design Center and then publish it to your Anypoint Exchange. We'll later deploy it as a Proxy Application as mentioned in the steps below. Do not deploy the API until Client Provider is registered on Anypoint Platform (Just follow the events as...

HTTP Redirection or Forwarding using Mule App

Image
This document covers a Mule Application code that is capable to taking some input parameters or payload and after some kind of processing, it can redirect or forward the flow to another URL. Such implementation is made possible with HTTP Listener and can be useful in a variety of use-cases. Let’s begin... Pre-requisites Postman Anypoint Studio Anypoint Studio Code Create a new Mule Application project in Anypoint Studio. Open the project’s main  *.xml  file and use the following XML code to setup a listener flow - <flow    name="http-RedirectFlow"    doc:id="0a946780-95b5-4dea-a0db-37efe5f3f36b"  >   <http:listener      doc:name="/request"      doc:id="77f08c1c-da16-4f7e-b591-385cfd036593"      config-ref="HTTP_Listener_config"      path="/request"   >     <http:response       statusCode='#["302"]'      >     ...

Run Flex Gateway in Linux VM for Non-Mule API

Image
This document covers steps to setup Anypoint Flex Gateway as a Service in a Linux virtual machine. The Linux distribution being used here is Ubuntu Server. It will be running inside a virtual machine using VMware Workstation Player in the local Windows environment. The API being used will be a Non-Mule API from SampleAPIs.com called Coffee . You'll find a RAML for it in pre-requisites section. We'll publish it to the Anypoint Exchange and then use our Flex Gateway as an API Gateway for it. We'll also briefly cover installation of Ubuntu Server in VMware Workstation Player. Let’s begin... Pre-requisites Installed VMware Workstation Player -  Link Ubuntu Server ISO (LTS Version Recommended) -  Link Installed OpenSSH Client in your Windows System - Link Mulesoft Anypoint Platform Account Coffee SampleAPI RAML File - Link Postman Setup Ubuntu Server in VMware Open VMware Workstation Player and click on Create a New Virtual Machine link on the right side. In the New Virtual Mac...