Configure Auth0

To use Auth0 as an OAuth 2.0 authorization server, you'll need to execute the following setup steps:

  1. Create an Auth0 API and Non Interactive Client.
  2. Create a Connection to store your users.
  3. Create a user so that you can test your integration when you've finished setting it up.

Step 1: Create an API and Non Interactive Client

An API is an entity that represents an external resource that's capable of accepting and responding to requests made by clients. You'll need to create an Auth0 API using the Management Dashboard to represent the API managed by Azure's API Management Service that you want secured by Auth0.

You'll also need a Non Interactive Client, which represents your application and allows use of Auth0 for authentication. When you create an API, Auth0 automatically creates an associated non interactive client by default.

To begin, you'll need to log into the Auth0 Management Dashboard. Go the APIs and click Create API.

Set the following parameters to create your new API:

Parameter Description
Name A descriptive name for your API. In this example, we'll use Basic Calculator
Identifier A logical and unique identifier for your API. We recommend using a URL, but it doesn't have to be a publicly-available URL since Auth0 doesn't call your API. You cannot modify this value at a later point. We'll use basic-calculator
Signing Algorithm The method used to sign the tokens issued by Auth0. Choose from HS256 and RS256 (we'll use the latter for this example). If you choose RS256, Auth0 signs your tokens with your private key. See Signing Algorithms for additional information

When complete, click Create.

When your API is ready, you'll be shown the Quick Start page for the API. Switch over to the Non Interactive Clients tab. You'll see that Auth0 has also created and enabled a non interactive client for use with your API.

Step 2: Create a Connection

After you've created your API and your Client, you'll need to create a Connection, which is a source of users. For the purposes of this example, we'll create a Database Connection.

If you already have a set of users, you may import them or create a custom database connection.

Go to the Management Dashboard. Navigate to Connections > Database Connections, and click Create DB Connection.

The only thing you'll need to provide at this time is a descriptive Name for your connection. We suggest choosing a name that reflects the source of users (such as Facebook for a Connection that contains users using their Facebook credentials or site-sign-ups for a database connection where users sign up on your site).

Click Create to proceed.

Enable the Connection for Your Client

Once Auth0 has created your Connection, you'll be redirected to your Connection's Settings page. Switch over to the Clients tab, where you'll see a full list of all the Clients you have with this account. You'll need to enable the Connection for use with the Non Interactive Client that you're using with your API.

Step 3: Create a User

Finally, we'll create a user that we use later on to test the integration.

Go to the Users section of the Management Dashboard. Click Create User.

Provide an email and password for your new user. Be sure to indicate that this user should use BasicCalculator in the Connection field.

Set Connection to the connection you created earlier (which, if you're following along with our example, is BasicCalculator).

Click Save to proceed.

At this point, you've set up Auth0 for use as an OAuth 2.0 authorization server. You will now configure the Azure API Management Service and import an API for use with the service.