You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article guides you through the steps required to create a [managed connection](credentials-overview.md) to the Microsoft Graph API within Azure API Management. The Microsoft Entra identity provider is used to call the Microsoft Graph API. The authorization code grant type is used in this example.
17
+
This article guides you through the steps required to create a [managed connection](credentials-overview.md) to the Microsoft Graph API within Azure API Management. Use the Microsoft Entra identity provider to call the Microsoft Graph API. This example uses the authorization code grant type.
18
18
19
19
You learn how to:
20
20
@@ -45,9 +45,9 @@ Create a Microsoft Entra application for the API and give it the appropriate per
45
45
46
46
1. Search for and select **Microsoft Entra ID**.
47
47
48
-
1. Under **Manage** on the sidebar menu, select **App registrations**, and then select **+ New registration**.
48
+
1. Under **Manage** on the sidebar menu, select **App registrations**, then select **+ New registration**.
49
49
50
-
1. On the **Register an application** page, enter your application registration settings:
50
+
1. On **Register an application**, enter your application registration settings:
51
51
1. In **Name**, enter a meaningful name for the app, such as *MicrosoftGraphAuth*.
52
52
1. In **Supported account types**, select an option that suits your scenario, for example, **Accounts in this organizational directory only (Single tenant)**.
53
53
1. Set the **Redirect URI** to **Web**, and enter `https://authorization-manager.consent.azure-apim.net/redirect/apim/<YOUR-APIM-SERVICENAME>`, substituting the name of the API Management service where you'll configure the credential provider.
@@ -56,18 +56,18 @@ Create a Microsoft Entra application for the API and give it the appropriate per
56
56
:::image type="content" source="media/credentials-how-to-azure-ad/create-registration.png" alt-text="Screenshot of creating a Microsoft Entra app registration in the portal.":::
57
57
58
58
1. On the sidebar menu, select **Manage** > **API permissions**.
59
-
Make sure the permission **User.Read** with the type *Delegated*has already been added.
59
+
Make sure the permission **User.Read** with the type *Delegated*is already added.
60
60
61
61
1. Select **+ Add a permission**.
62
62
:::image type="content" source="./media/credentials-how-to-azure-ad/add-permission.png" alt-text="Screenshot of adding an API permission in the portal.":::
63
63
64
-
1. Select **Microsoft Graph**, and then select **Delegated permissions**.
65
-
1. Type **Team**, expand the **Team** options, and then select **Team.ReadBasic.All**. Select **Add permissions**.
64
+
1. Select **Microsoft Graph**, then select **Delegated permissions**.
65
+
1. Type **Team**, expand the **Team** options, then select **Team.ReadBasic.All**. Select **Add permissions**.
66
66
1. Next, select **Grant admin consent for Default Directory**. The status of the permissions changes to **Granted for Default Directory**.
67
67
68
-
1. On the sidebar menu, select **Overview**. On the **Overview** page, find the **Application (client) ID** value and record it for use in Step 2.
68
+
1. On the sidebar menu, select **Overview**. On **Overview**, find the **Application (client) ID** value and record it for use in Step 2.
69
69
70
-
1. On the sidebar menu, select **Manage** >**Certificates & secrets**, and then select **+ New client secret**.
70
+
1. On the sidebar menu, select **Manage** >**Certificates & secrets**, then select **+ New client secret**.
71
71
:::image type="content" source="media/credentials-how-to-azure-ad/create-secret.png" alt-text="Screenshot of creating an app secret in the portal.":::
72
72
73
73
1. Enter a **Description**.
@@ -79,10 +79,10 @@ Create a Microsoft Entra application for the API and give it the appropriate per
79
79
80
80
1. Go to your API Management instance.
81
81
82
-
1. Under **APIs** on the sidebar menu, select **Credential manager**, and then select **+ Create**.
82
+
1. Under **APIs** on the sidebar menu, select **Credential manager**, then select **+ Create**.
83
83
:::image type="content" source="media/credentials-how-to-azure-ad/create-credential.png" alt-text="Screenshot of creating an API credential in the portal.":::
84
84
85
-
1. On the **Create credential provider** page, enter the following settings, and select **Create**:
85
+
1. On **Create credential provider**, enter the following settings, and select **Create**:
86
86
87
87
|Settings |Value |
88
88
|---------|---------|
@@ -169,7 +169,7 @@ On the **Connection** tab, complete the steps for your connection to the provide
169
169
170
170
The preceding policy definition consists of two parts:
171
171
172
-
* The [get-authorization-context](get-authorization-context-policy.md) policy fetches an authorization token by referencing the credential provider and connection that were created earlier.
172
+
* The [get-authorization-context](get-authorization-context-policy.md) policy fetches an authorization token by referencing the credential provider and connection that you created earlier.
173
173
* The [set-header](set-header-policy.md) policy creates an HTTP header with the fetched access token.
In this article, you learn how to create a managed [connection](credentials-overview.md) in API Management and call a GitHub API that requires an OAuth 2.0 token. The authorization code grant type is used in this example.
17
+
In this article, you learn how to create a managed [connection](credentials-overview.md) in API Management and call a GitHub API that requires an OAuth 2.0 token. This example uses the authorization code grant type.
18
18
19
19
You learn how to:
20
20
@@ -27,8 +27,8 @@ You learn how to:
27
27
28
28
## Prerequisites
29
29
30
-
* A GitHub account is required.
31
-
* A running API Management instance. If you need to, [create an Azure API Management instance](get-started-create-service-instance.md).
30
+
* A GitHub account.
31
+
* A running API Management instance. If you need one, [create an Azure API Management instance](get-started-create-service-instance.md).
32
32
* Enable a [system-assigned managed identity](api-management-howto-use-managed-service-identity.md) for API Management in the API Management instance.
33
33
34
34
## Step 1: Register an application in GitHub
@@ -41,21 +41,21 @@ Create a GitHub OAuth app for the API and give it the appropriate permissions fo
41
41
:::image type="content" source="media/credentials-how-to-github/register-application.png" alt-text="Screenshot of registering a new OAuth application in GitHub.":::
42
42
1. Enter an **Application name** and **Homepage URL** for the application. For this example, you can supply a placeholder URL such as `http://localhost`.
43
43
1. Optionally, add an **Application description**.
44
-
1. In **Authorization callback URL** (the redirect URL), enter `https://authorization-manager.consent.azure-apim.net/redirect/apim/<YOUR-APIM-SERVICENAME>`, substituting the name of the API Management instance where you will configure the credential provider.
44
+
1. In **Authorization callback URL** (the redirect URL), enter `https://authorization-manager.consent.azure-apim.net/redirect/apim/<YOUR-APIM-SERVICENAME>`, substituting the name of the API Management instance where you configure the credential provider.
45
45
1. Optionally select **Enable device flow** (not required for this example).
46
46
1. Select **Register application**.
47
-
1. On the **General** page, copy the **Client ID**, which you'll use in Step 2.
48
-
1. Select **Generate a new client secret**. Copy the secret, which won't be displayed again. You'll configure the secret in Step 2.
47
+
1. On the **General** page, copy the **Client ID**, which you use in Step 2.
48
+
1. Select **Generate a new client secret**. Copy the secret, which isn't displayed again. You configure the secret in Step 2.
49
49
50
50
:::image type="content" source="media/credentials-how-to-github/generate-secret.png" alt-text="Screenshot showing how to get client ID and client secret for the application in GitHub.":::
51
51
52
52
## Step 2: Configure a credential provider in API Management
53
53
54
-
1. Sign into the [Azure portal](https://portal.azure.com) and go to your API Management instance.
54
+
1. Sign in to the [Azure portal](https://portal.azure.com) and go to your API Management instance.
55
55
1. On the left menu, select **APIs** > **Credential manager** > **+ Create**.
56
56
57
57
:::image type="content" source="media/credentials-how-to-azure-ad/create-credential.png" alt-text="Screenshot of creating an API Management credential in the Azure portal.":::
58
-
1. On the **Create credential provider** page, enter the following settings:
58
+
1. On **Create credential provider**, enter the following settings:
59
59
60
60
|Settings |Value |
61
61
|---------|---------|
@@ -83,7 +83,7 @@ On the **Connection** tab, complete the steps for your connection to the provide
83
83
84
84
## Step 4: Create an API in API Management and configure a policy
85
85
86
-
1. Sign into the [Azure portal](https://portal.azure.com) and go to your API Management instance.
86
+
1. Sign in to the [Azure portal](https://portal.azure.com) and go to your API Management instance.
87
87
1. On the left menu, select **APIs** > **APIs** > **+ Add API**.
88
88
1. Select **HTTP** and enter the following settings, then select **Create**.
89
89
@@ -93,7 +93,7 @@ On the **Connection** tab, complete the steps for your connection to the provide
93
93
|**Web service URL**|`https://api.github.com`|
94
94
|**API URL suffix**|*githubuser*|
95
95
96
-
1.Navigate to the newly created API and select **Add Operation**. Enter the following settings and select **Save**.
96
+
1.Go to the new API and select **Add Operation**. Enter the following settings and select **Save**.
97
97
98
98
|Setting |Value |
99
99
|---------|---------|
@@ -110,7 +110,7 @@ On the **Connection** tab, complete the steps for your connection to the provide
110
110
|**URL** for GET | /user/followers |
111
111
112
112
1. Select **All operations**. In the **Inbound processing** section, select the (**</>**) (code editor) icon.
113
-
1. Copy and paste the following in the policy editor. Make sure the `provider-id` and `authorization-id` values in the `get-authorization-context` policy correspond to the names of the credential provider and connection, respectively, that you configured in the preceding steps. Select **Save**.
113
+
1. Copy and paste the following code in the policy editor. Make sure the `provider-id` and `authorization-id` values in the `get-authorization-context` policy correspond to the names of the credential provider and connection, respectively, that you configured in the preceding steps. Select **Save**.
0 commit comments