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
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/secure-api-management.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ You need the following resources in place before continuing with the steps in th
31
31
32
32
When you secure an API in Azure API Management with Azure AD B2C, you need several values for the [inbound policy](../api-management/api-management-howto-policies.md) that you create in APIM. First, record the application ID of an application you've previously created in your Azure AD B2C tenant. If you're using the application you created in the prerequisites, use the application ID for *webbapp1*.
33
33
34
-
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com)
35
-
1. Under **Manage**, select **Applications**
34
+
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com).
35
+
1. Under **Manage**, select **Applications**.
36
36
1. Record the value in the **APPLICATION ID** for *webapp1* or another application you've previously created.
37
37
38
38

@@ -41,9 +41,9 @@ When you secure an API in Azure API Management with Azure AD B2C, you need sever
41
41
42
42
Next, get the well-known config URL for one of your Azure AD B2C user flows. You also need the token issuer endpoint URI you want to support in Azure API Management.
43
43
44
-
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com)
45
-
1. Under **Policies**, select **User flows (policies)**
46
-
1. Select an existing policy, for example *B2C_1_signupsignin1*, then select **Run user flow**
44
+
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com).
45
+
1. Under **Policies**, select **User flows (policies)**.
46
+
1. Select an existing policy, for example *B2C_1_signupsignin1*, then select **Run user flow**.
47
47
1. Record the URL in hyperlink displayed under the **Run user flow** heading near the top of the page. This URL is the OpenID Connect well-known discovery endpoint for the user flow, and you use it in the next section when you configure the inbound policy in Azure API Management.
48
48
49
49

You're now ready to add the inbound policy in Azure API Management that validates API calls. By adding a [JWT validation](../api-management/api-management-access-restriction-policies.md#ValidateJWT) policy that verifies the audience and issuer in an access token, you can ensure that only API calls with a valid token are accepted.
68
68
69
-
1. Browse to your Azure API Management instance in the [Azure portal](https://portal.azure.com)
70
-
1. Select **APIs**
71
-
1. Select the API that you want to secure with Azure AD B2C
72
-
1. Select the **Design** tab
73
-
1. Under **Inbound processing**, select **\</\>** to open the policy code editor
69
+
1. Browse to your Azure API Management instance in the [Azure portal](https://portal.azure.com).
70
+
1. Select **APIs**.
71
+
1. Select the API that you want to secure with Azure AD B2C.
72
+
1. Select the **Design** tab.
73
+
1. Under **Inbound processing**, select **\</\>** to open the policy code editor.
74
74
1. Place the following `<validate-jwt>` tag inside the `<inbound>` policy.
75
75
76
76
1. Update the `url` value in the `<openid-config>` element with your policy's well-known configuration URL.
@@ -107,12 +107,12 @@ To call the API, you need both an access token issued by Azure AD B2C, and an AP
107
107
108
108
You first need a token issued by Azure AD B2C to use in the `Authorization` header in Postman. You can get one by using the **Run now** feature of your sign-up/sign-in user flow you should have created as one of the prerequisites.
109
109
110
-
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com)
111
-
1. Under **Policies**, select **User flows (policies)**
112
-
1. Select an existing sign-up/sign-in user flow, for example *B2C_1_signupsignin1*
113
-
1. For **Application**, select *webapp1*
114
-
1. For **Reply URL**, choose `https://jwt.ms`
115
-
1. Select **Run user flow**
110
+
1. Browse to your Azure AD B2C tenant in the [Azure portal](https://portal.azure.com).
111
+
1. Under **Policies**, select **User flows (policies)**.
112
+
1. Select an existing sign-up/sign-in user flow, for example *B2C_1_signupsignin1*.
113
+
1. For **Application**, select *webapp1*.
114
+
1. For **Reply URL**, choose `https://jwt.ms`.
115
+
1. Select **Run user flow**.
116
116
117
117

118
118
@@ -125,9 +125,9 @@ You first need a token issued by Azure AD B2C to use in the `Authorization` head
125
125
126
126
A client application (in this case, Postman) that calls a published API must include a valid API Management subscription key in its HTTP requests to the API. To get a subscription key to include in your Postman HTTP request:
127
127
128
-
1. Browse to your Azure API Management service instance in the [Azure portal](https://portal.azure.com)
129
-
1. Select **Subscriptions**
130
-
1. Select the ellipsis for **Product: Unlimited**, then select **Show/hide keys**
128
+
1. Browse to your Azure API Management service instance in the [Azure portal](https://portal.azure.com).
129
+
1. Select **Subscriptions**.
130
+
1. Select the ellipsis for **Product: Unlimited**, then select **Show/hide keys**.
131
131
1. Record the **PRIMARY KEY** for the product. You use this key for the `Ocp-Apim-Subscription-Key` header in your HTTP request in Postman.
132
132
133
133

0 commit comments