Configuring Azure for Dynamic Client Registration
Prerequisites
- Enterprise Konnect account.
- An Azure AD account.
Note: Dynamic client registration supports Azure OAuth v1 token endpoints only. v2 is not supported.
Configure Azure
In Azure, create the main application:
-
In Azure Active Directory, click App registrations and then click New registration.
- Enter a name for the application.
-
Ensure Accounts in this organizational directory only is selected for Supported account types.
-
Click Register.
- On the application view, go to API permissions, click Add permissions > Microsoft Graph and select the following:
- Application.Read.All
- Application.ReadWrite.All
- Application.ReadWrite.OwnedBy
- User.Read
-
Once added, click Grant admin consent. An administrator with Global Admin rights is required for this step.
-
Select Certificates & secrets and then create a client secret and save it in a secure location. You can only view the secret once.
- On the Overview view, note your Directory (tenant) ID and Application (client) ID.
Configure the Dev Portal
Once you have Azure configured, you can set up the Dev Portal to use Azure for dynamic client registration (DCR).
-
Sign in to Konnect, then select
Dev Portal from the menu.
-
Click Settings to open the Dev Portal settings.
-
Click the Application Setup tab to open the DCR settings for your Dev Portal.
-
Select Azure as the external identity provider..
-
Enter the Issuer for your Azure tenant, it will look something like
https://sts.windows.net/YOUR_TENANT_ID
. -
Enter
appid
in the Consumer claims field. -
Select the auth method you want to enable.
-
Enter your Application (client) ID from Azure in the Initial Client ID field.
-
Enter the Client secret from the admin application created in Azure into the Initial Client Secret field..
-
Click Save.
If you previously configured any DCR settings, this will overwrite them.
Create an application with DCR
From the My Apps page in the Dev Portal, follow these instructions:
-
Click the New App button.
-
Fill out the Create New Application form with your application name and a description.
-
Click Create to save your application.
-
After your application has been created, you will see the Client ID and Client Secret. Store these values, they will only be shown once.
-
Click Proceed to continue to the application’s details page.
Once your application is created, you will see it in Azure. From your Azure homepage select App registrations > All applications. You will see your application that was created in the Dev Portal.
Make a successful request
In the previous steps, you obtained the Client ID and Client Secret. To authorize the request, you must attach this client secret pair in the header. You can do this by using any API product, such as Insomnia, or directly using the command line:
curl example.com/REGISTERED_ROUTE -H "Authorization: Basic CLIENT_ID:CLIENT_SECRET"
Where example.com
is the address of the data plane node.
You can also request a bearer token from Azure using this command, using an OAuth2 v1 token endpoint:
curl --request GET \
--url https://login.microsoftonline.com/TENANT_ID/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=CLIENT_ID \
--data 'scope=https://graph.microsoft.com/.default' \
--data 'client_secret=CLIENT_SECRET'