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/api-management/howto-protect-backend-frontend-azure-ad-b2c.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,27 +182,26 @@ Open the Azure AD B2C blade in the portal and do the following steps.
182
182
183
183
1. Two extra areas in the function app need to be configured (Authorization and Network Restrictions).
184
184
1. Firstly Let's configure Authentication / Authorization, so navigate back to the root blade of the function app via the breadcrumb.
185
-
1. Next select 'Authentication / Authorization' (under 'Settings').
186
-
1. Turn on the App Service Authentication feature.
187
-
1. Set the Action to take when request is not authenticated dropdown to "Log in with Azure Active Directory".
188
-
1. Under 'Authentication Providers', choose ‘Azure Active Directory’.
189
-
1. Choose ‘Advanced’ from the Management Mode switch.
190
-
1. Paste the Backend application's [Application] Client ID (from Azure AD B2C) into the ‘Client ID’ box
185
+
1. Next select 'Authentication' (under 'Settings').
186
+
1. Click 'Add Identity Provider'
187
+
1. From the Identity Provider dropdown, select 'Microsoft'
188
+
1. For App Registration, select 'Provide the details of an existing app registration'
189
+
1. Paste the Backend application's client ID (from Azure AD B2C) into the ‘Application (client) ID’ box (we recorded this configuration earlier).
191
190
1. Paste the Well-known open-id configuration endpoint from the sign-up and sign-in policy into the Issuer URL box (we recorded this configuration earlier).
192
-
1.Click 'Show Secret' and paste the Backend application's client secret into the appropriate box.
193
-
1.Select OK, which takes you back to the identity provider selection blade/screen.
194
-
1. Leave [Token Store](../app-service/overview-authentication-authorization.md#token-store) enabled under advanced settings (default).
191
+
1.Paste the Backend application's client secret into the appropriate box (we recorded this configuration earlier).
192
+
1.For 'Unauthenticated requests', select 'HTTP 401 Unauthorized: recommended for APIs'
> Now your Function API is deployed and should throw 401 responses if the correct JWT is not supplied as an Authorization: Bearer header, and should return data when a valid request is presented.
199
-
> You added additional defense-in-depth security in EasyAuth by configuring the 'Login With Azure AD' option to handle unauthenticated requests. Be aware that this will change the unauthorized request behavior between the Backend Function App and Frontend SPA as EasyAuth will issue a 302 redirect to Azure Active Directory instead of a 401 Not Authorized response, we will correct this by using API Management later.
198
+
> You added additional defense-in-depth security in EasyAuth by configuring the 'Login With Azure AD' option to handle unauthenticated requests.
200
199
>
201
200
> We still have no IP security applied, if you have a valid key and OAuth2 token, anyone can call this from anywhere - ideally we want to force all requests to come via API Management.
202
201
>
203
202
> If you're using APIM Consumption tier then [there isn't a dedicated Azure API Management Virtual IP](./api-management-howto-ip-addresses.md#ip-addresses-of-consumption-tier-api-management-service) to allow-list with the functions access-restrictions. In the Azure API Management Standard SKU and above [the VIP is single tenant and for the lifetime of the resource](./api-management-howto-ip-addresses.md#changes-to-the-ip-addresses). For the Azure API Management Consumption tier, you can lock down your API calls via the shared secret function key in the portion of the URI you copied above. Also, for the Consumption tier - steps 12-17 below do not apply.
204
203
205
-
1. Close the 'Authentication / Authorization' blade
204
+
1. Close the 'Authentication' blade from the App Service / Functions portal.
206
205
1. Open the *API Management blade of the portal*, then open *your instance*.
207
206
1. Record the Private VIP shown on the overview tab.
208
207
1. Return to the *Azure Functions blade of the portal* then open *your instance* again.
@@ -463,4 +462,4 @@ The steps above can be adapted and edited to allow many different uses of Azure
463
462
* Check out more [videos](https://azure.microsoft.com/documentation/videos/index/?services=api-management) about API Management.
464
463
* For other ways to secure your back-end service, see [Mutual Certificate authentication](api-management-howto-mutual-certificates.md).
465
464
*[Create an API Management service instance](get-started-create-service-instance.md).
0 commit comments