---
schema_version: "1"
id: 3a3a550f421ac4632e1b201cd0613ee4994a91a250a288fd043ef541ae6d5fab
title: Configuring OAuth 2.0 for Connectors on CloudHub
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/connectors/introduction/intro-config-oauth2-cloudhub.md
canonical_url: https://docs.mulesoft.com/connectors/introduction/intro-config-oauth2-cloudhub
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 96763b465ae00e72e2a93a2f83642fb0ef450f589dfcc3e44a8c09e7408ad826
description: MuleSoft Documentation Site
latest: true
---
---
product: Connectors
---

# Configuring OAuth 2.0 for Connectors on CloudHub

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

You can deploy your OAuth 2.0 enabled connectors to a cloud service.

Configuring OAuth 2.0 for a connector on CloudHub is the same as configuring OAuth 2.0 for a
connector locally, except with CloudHub, the Mule implementation is behind an extra server. Consider
the following when configuring OAuth 2.0 for a connector on CloudHub:

- Connector Listener

  - CloudHub manages some
    [properties](https://docs.mulesoft.com/cloudhub/cloudhub-manage-props#cloudhub-reserved-properties) for you
    automatically, such as `${http.port}` and `${https.port}`. Use these properties when configuring
    your **HTTP Listener**.

    ![Http Listener configuration window for CloudHub example](/mulesoft/current/en-us/connectors/_images/intro-config-oauth2-cloudhub-img1.png)

  - When deployed on the cloud, the `localhost`, `0.0.0.0`, and `127.0.0.1` hosts are no longer
    publicly reachable. When configuring your OAuth provider, you must replace all links containing
    these hosts with the actual CloudHub-provided public addresses. For CloudHub, this address is in
    the format `{ch-app-name}.{region}.cloudhub.io`. For example, an HTTP app named `ch-example-app`
    deployed in the Europe (London)
    [region](https://docs.mulesoft.com/cloudhub/cloudhub-networking-guide#regional-services) has public address of
    `http://ch-example-app.uk-e1.cloudhub.io`.

- OAuth Provider Setup

  - If you set **Callback Path** to `/callback`, your public callback URL is
    `{ch-app-name}.{region}.cloudhub.io/callback`. This is the callback URL to use as your redirect
    URI when you configure your OAuth provider.

    ![OKTA Example](/mulesoft/current/en-us/connectors/_images/intro-config-oauth2-cloudhub-idp-example.png)

    This must also be configured in your connector as the **External Callback Url**. You can use the
    `${fullDomain}` property that CloudHub configures for you to automatically obtain the proper
    host name.

    ![External Callback Url field configuration window](/mulesoft/current/en-us/connectors/_images/intro-config-oauth2-cloudhub-callback-config.png)

    > [!NOTE] If you are deploying to multiple regions or have some other gateway configured, use
    > the hostname of the load balancer or the gateway in your OAuth provider callback URL and in
    > **External Callback Url**.
    >
    > If your Salesforce instance doesn’t support HTTP or HTTPS callback URLs with private cloud
    > URLs, you can update the callback URL to use a public endpoint.

    In OAuth 2.0 configuration, the user (not the OAuth provider) reaches the callback endpoint from
    their browser. Ensure that your region configuration is correct. If you create your CloudHub app
    in the US region and your users connect to the app from Europe, the request is blocked by the
    gateway.

## Performing the OAuth Dance

After you complete the OAuth 2.0 configuration, you can deploy your app to CloudHub and initialize
the OAuth dance by navigating to your public hostname on your authorization endpoint. For example,
with the previous configuration, you can navigate to `{ch-app-name}.{region}.cloudhub.io/authorize`.
This starts the OAuth dance and prompts you to log in with your OAuth provider.

## See Also

- [Configuring OAuth 2.0 for Connectors](https://docs.mulesoft.com/connectors/introduction/intro-config-oauth2)

- [Deploying to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub)

- [Salesforce Help](https://help.salesforce.com)
