Integrating External Apps with Anypoint Platform | MuleSoft Guide

This guide explores Connected Apps, a feature that allows you to integrate external applications with Anypoint Platform without compromising security. By leveraging OAuth 2.0 or OpenID Connect, you can grant access to resources without revealing user credentials.

Supported Authentication Protocols

  • OAuth 2.0 (Open Authorization): An industry-standard protocol for secure API authorization. It enables applications to request access to resources without exposing user credentials.
  • OpenID Connect: Extends OAuth 2.0 to simplify user identity management. It facilitates user identification and data collection for connected apps.

Benefits of Connected Apps

  • Seamless Integration: Integrate external applications into your Anypoint Platform ecosystem.
  • Scalability: An organization can create up to 200 Connected Apps, each supporting up to 1000 scopes.
  • Granular Access Control: Grant or revoke access to specific resources based on your requirements.
  • Enhanced Auditability: Track and audit Connected Apps usage for improved security and monitoring.

Creating Connected Apps

  1. Access Management: Sign in to your Anypoint Platform account and navigate to the Access Management section. Select Connected Apps.

Note: The Connected Apps option might not be available if you’re below the root level of your organization’s hierarchy.

  1. Create a New App: Under Owned Apps, click Create App. Enter a name for your app and select “App acts on its own behalf (client credentials)”.
  2. Define Scopes: Click “Add Scopes” and select the scopes required for the app to interact with Anypoint Platform functionalities.
  1. Environment and Business Group: Choose the Business Group and environments you want to associate with the app.
  1. Review and Save: Click Review, then Add Scope, and finally, click Save. Navigate back to the Connected Apps section to confirm the app’s creation.

Deploying a Mule Application to CloudHub with Connected Apps

  1. Maven pom.xml Configuration: Add the following code snippet to the plugins section of your pom.xml file:
<plugin>  <groupId>org.mule.tools.maven</groupId>  <artifactId>mule-maven-plugin</artifactId>  <version>3.4.2</version>  <extensions>true</extensions>  <configuration>    <cloudHubDeployment>      <uri>https://anypoint.mulesoft.com</uri>      <muleVersion>${app.runtime}</muleVersion>      <connectedAppClientId>${connectedApp-ClientID}</connectedAppClientId>      <connectedAppClientSecret>${connectedApp-ClientSecret}</connectedAppClientSecret>      <connectedAppGrantType>client_credentials</connectedAppGrantType>      <applicationName>${cloudhub.application.name}</applicationName>      <environment>${environment}</environment>      <region>${region}</region>      <workers>${workers}</workers>      <workerType>${workerType}</workerType>      <objectStoreV2>true</objectStoreV2>    </cloudHubDeployment>  </configuration></plugin>
  1. Obtain Credentials: The values for connectedAppClientId and connectedAppClientSecret can be found in the Connected Apps section of Anypoint Platform.
  1. Deployment Command: Deploy your Mule application to CloudHub using Maven with the following command:
mvn clean package deploy -DmuleDeploy
]]>
Post a Comment (0)
Previous Post Next Post