---
schema_version: "1"
id: 75041bb7feceb853e403ea97966d98e886efd538445fed5b66ef857f45182431
title: Connected Application Authentication
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/exchange/connected-app-authentication.md
canonical_url: https://docs.mulesoft.com/exchange/connected-app-authentication
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7b98f8319b247453340a4eafebc090fcd033096ec5cd60ad8e7bce0ffddbe494
description: MuleSoft Documentation Site
latest: true
---
---
product: Exchange
---

# Connected Application Authentication

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Connected application authentication enables access to Exchange using OAuth 2.0 client credentials,
so you can execute Exchange requests without sending user credentials.

## Create a Connected Application

To create a new connected application:

1.  Log in to Anypoint Platform.

2.  Go to **Access Management** > **Connected Apps** > **Create App**.

3.  Select **App acts on its own behalf (client credentials)**.

4.  Click **Add Scopes** and add the appropriate Exchange scopes:

    - **Exchange Administrator** or **Exchange Contributor** for read and write access

    - **Exchange Viewer** for read-only access

5.  Select the business groups and environments for the scopes, and click **Add Scopes**.

6.  Click **Save** and copy the client ID and client secret of the connected application.

For more information about creating connected apps, see
[Creating Connected Apps in Anypoint Platform](https://docs.mulesoft.com/access-management/creating-connected-apps-dev).

## Obtain a Bearer Token

Use the OAuth 2.0 `client_credentials` grant type to obtain a bearer token for the connected
application. Replace `CLIENT_ID` and `CLIENT_SECRET` with your client ID and secret:

```console
curl --location --request POST 'https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=CLIENT_ID' \
--data-urlencode 'client_secret=CLIENT_SECRET' \
--data-urlencode 'grant_type=client_credentials'
```

You receive a response similar to:

```json
{
  "access_token": "YOUR_BEARER_TOKEN",
  "token_type": "bearer"
}
```

Use this bearer token in Exchange API calls by including it in the `Authorization` header:

```console
curl -H 'Authorization: bearer YOUR_BEARER_TOKEN' \
https://anypoint.mulesoft.com/exchange/api/v2/assets
```

## Basic Authentication for Maven Facade and Graph API

The Exchange Maven Facade API and the Exchange Graph API also support a basic authentication
shortcut using connected application credentials directly. To use this method, define the username
as `~~~Client~~~` and the password as `clientID~?~clientSecret`.

Replace `clientID` with the client ID and `clientSecret` with the client secret.

For example, in a Maven `settings.xml` file:

```xml
<servers>
  <server>
    <id>Repository</id>
    <username>~~~Client~~~</username>
    <password>clientID~?~clientSecret</password>
  </server>
</servers>
```

For the Exchange Experience API, MuleSoft recommends using the
[bearer token method](#obtain-a-bearer-token).

## See Also

- [Getting the Bearer Token for a Connected App in Anypoint Platform](https://docs.mulesoft.com/access-management/connected-app-bearer-token-example)

- [Connected Apps in Anypoint Platform](https://docs.mulesoft.com/access-management/connected-apps-overview)

- [Publishing Assets Using the Exchange API](https://docs.mulesoft.com/exchange/exchange-api)

- [Publishing Assets Using Maven](https://docs.mulesoft.com/exchange/to-publish-assets-maven)
