Nav

To Build a Mule OAuth 2 Provider

To build a provider from MuleSoft Consulting on Mule Runtime 3.8.x, perform this task.

  1. Set up credentials in the Mule EE Repository by creating, or by adding the credentials to, the Maven settings.xml file. This file is typically located in ~/.m2/settings.xml on Linux or Mac OSX:

    
                
             
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    ...
      <servers>
        <server>
          <id>MuleRepository</id>
          <username>mule.username</username>
          <password>mule.password</password>
        </server>
      </servers>
    ...
      <profiles>
        <profile>
          <id>Mule</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
          <repositories>
            <repository>
              <id>MuleRepository</id>
              <name>MuleRepository</name>
              <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
    ...
            </repository>
          </repositories>
        </profile>
      </profiles>
  2. Download the OAuthProviderStudioArchive using the link at the bottom of this topic.

  3. Launch Studio, and choose File > Import.

  4. In Select, expand Anypoint Studio and choose Anypoint Studio Generated Deployable Archive.

  5. Browse to the OAuthProviderStudioArchive.zip you downloaded, and click Finish.

  6. Log into your Anypoint platform account.

  7. Access the client ID and client secret of the account you are using to create the provider application.

  8. Enter your client Id and client Secret in Anypoint Studio > Preferences > Anypoint Studio > Anypoint Platform for APIs.

    This step is necessary to test the local provider.

  9. In Project Explorer, right-click the project name and select Run As > Mule Application with Maven.

  10. In Configure Maven, enter your Maven installation home directory, and click Test Maven Configuration.

    Assuming the test was successful, click OK; otherwise, troubleshoot the Maven problem. The console reports that the app deployed. Next, test the local provider.

In this topic: