Skip to content

Commit 39b1c42

Browse files
committed
[b2c] fix .NET API tutorial
1 parent 44f621a commit 39b1c42

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

articles/active-directory-b2c/active-directory-b2c-tutorials-web-api.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Tutorial - Grant access to an ASP.NET web API - Azure Active Directory B2C | Microsoft Docs
2+
title: Tutorial - Grant access to an ASP.NET web API - Azure Active Directory B2C
33
description: Tutorial on how to use Active Directory B2C to protect an ASP.NET web API and call it from an ASP.NET web application.
44
services: active-directory-b2c
55
author: mmacy
66
manager: celestedg
77

88
ms.author: marsma
9-
ms.date: 02/04/2019
9+
ms.date: 09/18/2019
1010
ms.custom: mvc
1111
ms.topic: tutorial
1212
ms.service: active-directory
@@ -84,14 +84,14 @@ The following two projects are in the sample solution:
8484
### Configure the web application
8585

8686
1. Open the **B2C-WebAPI-DotNet** solution in Visual Studio.
87-
2. Open **Web.config** in the **TaskWebApp** project.
88-
3. To run the API locally, use the localhost setting for **api:TaskServiceUrl**. Change the Web.config as follows:
87+
1. Open **Web.config** in the **TaskWebApp** project.
88+
1. To run the API locally, use the localhost setting for **api:TaskServiceUrl**. Change the Web.config as follows:
8989

9090
```csharp
9191
<add key="api:TaskServiceUrl" value="https://localhost:44332/"/>
9292
```
9393

94-
3. Configure the URI of the API. This is the URI the web application uses to make the API request. Also, configure the requested permissions.
94+
1. Configure the URI of the API. This is the URI the web application uses to make the API request. Also, configure the requested permissions.
9595

9696
```csharp
9797
<add key="api:ApiIdentifier" value="https://<Your tenant name>.onmicrosoft.com/api/" />
@@ -102,25 +102,26 @@ The following two projects are in the sample solution:
102102
### Configure the web API
103103

104104
1. Open **Web.config** in the **TaskService** project.
105-
2. Configure the API to use your tenant.
105+
1. Configure the API to use your tenant.
106106

107107
```csharp
108+
<add key="ida:AadInstance" value="https://<Your tenant name>.b2clogin.com/{0}/{1}/v2.0/.well-known/openid-configuration" />
108109
<add key="ida:Tenant" value="<Your tenant name>.onmicrosoft.com" />
109110
```
110111

111-
3. Set the client ID to the registered Application ID for your API.
112+
1. Set the client ID to the registered Application ID for your API.
112113

113114
```csharp
114115
<add key="ida:ClientId" value="<application-ID>"/>
115116
```
116117

117-
4. Update the user flow setting with the name of the sign up and sign-in user flow.
118+
1. Update the user flow setting with the name of the sign up and sign-in user flow.
118119

119120
```csharp
120-
<add key="ida:SignUpSignInUserFlowId" value="B2C_1_signupsignin1" />
121+
<add key="ida:SignUpSignInPolicyId" value="B2C_1_signupsignin1" />
121122
```
122123

123-
5. Configure the scopes setting to match what you created in the portal.
124+
1. Configure the scopes setting to match what you created in the portal.
124125

125126
```csharp
126127
<add key="api:ReadScope" value="Hello.Read" />
@@ -132,15 +133,15 @@ The following two projects are in the sample solution:
132133
You need to run both the **TaskWebApp** and **TaskService** projects.
133134

134135
1. In Solution Explorer, right-click on the solution and select **Set StartUp Projects...**.
135-
2. Select **Multiple startup projects**.
136-
3. Change the **Action** for both projects to **Start**.
137-
4. Click **OK** to save the configuration.
138-
5. Press **F5** to run both applications. Each application opens in its own browser tab.
139-
`https://localhost:44316/` is the web application.
140-
`https://localhost:44332/` is the web API.
141-
142-
6. In the web application, click **sign-up / sign-in** to sign in to the web application. Use the account that you previously created.
143-
7. After you sign in, click **To-do list** and create a to-do list item.
136+
1. Select **Multiple startup projects**.
137+
1. Change the **Action** for both projects to **Start**.
138+
1. Click **OK** to save the configuration.
139+
1. Press **F5** to run both applications. Each application opens in its own browser window.
140+
* `https://localhost:44316/` is the web application.
141+
* `https://localhost:44332/` is the web API.
142+
143+
1. In the web application, select **sign-up / sign-in** to sign in to the web application. Use the account that you previously created.
144+
1. After you sign in, select **To-do list** and create a to-do list item.
144145

145146
When you create a to-do list item, the web application makes a request to the web API to generate the to-do list item. You're protected web application is calling the protected web API in your Azure AD B2C tenant.
146147

0 commit comments

Comments
 (0)