Contact Us 1-800-596-4880

To Deploy the Provider to a Remote Server

To use the access token to call an API managed by the OAuth 2.0 Access Token Enforcement Using External Provider policy, you first have to deploy the provider on a server. In this procedure, you deploy the provider to CloudHub. When you deploy the sample OAuth 2.0 provider, you set the client ID and client secret using Settings > Properties in Runtime Manager. Setting the client ID and client secret in Studio preferences does not suffice. The preferences are not synched with Runtime Manager property settings.

  1. In Studio, select File > Export.

    The Select dialog appears.

  2. Expand the Mule directory, and select Anypoint Studio Project to Mule Deployable Archive. Click Next.

    The Export Mule Project dialog appears.

  3. Select the project, browse to a location for saving the archive, name the archive, select Attach project sources, and click Finish.

  4. In Anypoint Platform, in Runtime Manager, click Deploy Application.

    The Deploy Application page appears.

  5. Configure the following settings:

    • Application Name—​Fill in an application name, for example auth-provider-testing.

    • Deployment Target—​Accept CloudHub as the deployment target.

    • Application File—​Choose the archive you exported from Studio.

    • Runtime version—​Select 3.8.0 or later for this example.

    • Worker size—​Select a worker size such as 0.1 vCores.

  6. On the Properties tab, add your client_id and client_secret. Use the following syntax, replacing the values shown in this example with your own client_id and client_secret:

    anypoint.platform.client_id=6be08ee8007446ebaa5831d444afcc2a
    anypoint.platform.client_secret=32de15d194fd4c7fAD8BDAE9BCF278D6
    building-an-external-oauth-2.0-provider-application-df5f1

    CloudHub requires these credentials. The credentials you entered in Anypoint Studio preferences earlier do not suffice because these credentials are not transferred to CloudHub.

  7. Click Deploy Application.