How to Create a Connected app in MuleSoft
What are connected apps:
A connected app can be used both by admins and developers ,
As an organization administrator, you are the only user who can view and manage connected apps in Access Management. You can use authorization policies to dictate which apps can be authorized to access user data, and you can add apps that users want to use to an allowlist.
With the Connected Apps feature, developers can delegate access to applications that use APIs to interact with Anypoint Platform programmatically. While some might use the Connected Apps feature to build CI/CD pipelines, others can productize additional third-party use-cases on top of Anypoint Platform.
Only developers who have the organization administrator permission can create apps and specify access scopes in Anypoint Platform.
To create a connected app in Mulesoft(i am creating a connected app that will help with MFA (unauthorized )error while publishing an asset to exchange) :
- Anypoint platform > Access Management > connected apps as below
Choose the option App acts on its own behalf, which will work as a service account while publishing an asset to exchange.
once selected proceed with adding scopes as below,
you can add the scopes as below for MFA error, where we need Exchange scopes specifically,
once, you select all for exchange you can click on next and select your business group and confirm to add scopes, so we will be able to save the connected app.
once saved, you will be able to see the app created with client id, secret as below,
We can now use the credentials in our settings.xml file instead of Anypoint Platform user name , password to solve the Authorization error while publishing the asset to exchange when MFA is enabled.
<server>
<id>Repository</id>
<username>~~~Client~~~</username>
<password>[ClientID]~?~[ClientSecret]</password>
</server>
Kindly, use the above format in settings.xml file
In the settings.xml file, define the username as [ClientID] / ~~Client~~ as it is and the password as [ClientSecret] (replacing [ClientID] with your client ID and [ClientSecret] with your client secret).
you can also read for reference:
Hope you enjoyed this blog post. If you have any questions or an idea about how to improve the article feel free to contact me.