Skip to content

Commit ee7ac3a

Browse files
committed
bug fixes and removing spaces
1 parent ed03901 commit ee7ac3a

8 files changed

+114
-109
lines changed

articles/active-directory/develop/howto-call-a-web-api-with-curl.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,16 @@ You may also notice the **User.Read** permission for the Microsoft Graph API. Th
184184

185185
1. Execute the following command to start the app:
186186

187+
### [.NET 6.0](#tab/dotnet6)
188+
189+
```bash
190+
dotnet run
191+
```
192+
193+
### [.NET 7.0](#tab/dotnet7)
194+
187195
```bash
188-
dotnet run
196+
dotnet run --launch-profile https
189197
```
190198

191199
1. An output similar to the following will appear. Record the port number in the `https://localhost:{port}` URL.
@@ -207,22 +215,22 @@ You may also notice the **User.Read** permission for the Microsoft Graph API. Th
207215

208216
1. Open a new terminal window and navigate to the folder where the web API project is located.
209217

210-
### [.NET 6.0](#tab/dotnet6)
218+
### [.NET 6.0](#tab/dotnet6)
211219

212-
1. Execute the following command to start the app:
220+
1. Execute the following command to start the app:
213221

214-
```bash
215-
dotnet run
216-
```
222+
```bash
223+
dotnet run
224+
```
217225

218-
### [.NET 7.0](#tab/dotnet7)
226+
### [.NET 7.0](#tab/dotnet7)
219227

220-
1. Execute the following command to start the app on the `https` profile:
228+
1. Execute the following command to start the app on the `https` profile:
221229

222-
```bash
223-
dotnet run -launch-profile https`
224-
```
225-
---
230+
```bash
231+
dotnet run --launch-profile https
232+
```
233+
---
226234

227235
1. An output similar to the following will appear. Record the port number in the `https://localhost:{port}` URL.
228236

articles/active-directory/develop/single-page-app-tutorial-01-register-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In this tutorial:
2323
2424
## Prerequisites
2525

26-
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
26+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
2727
* This Azure account must have permissions to manage applications. Any of the following Azure AD roles include the required permissions:
2828
* Application administrator
2929
* Application developer

articles/active-directory/develop/web-api-tutorial-01-register-app.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,63 @@ ms.date: 11/1/2022
1010
#Customer intent: As an application developer, I want to know how to register my application with the Microsoft identity platform so that the security token service can issue access tokens to client applications that request them.
1111
---
1212

13-
# Tutorial: Register a web API with the Microsoft identity platform
13+
# Tutorial: Register a web API with the Microsoft identity platform
1414

15-
To interact with the Microsoft identity platform, Azure Active Directory (Azure AD) must be made aware of the application you create. This tutorial shows you how to register an application in a tenant on the Azure portal.
15+
To interact with the Microsoft identity platform, Azure Active Directory (Azure AD) must be made aware of the application you create. This tutorial shows you how to register an application in a tenant on the Azure portal.
1616

17-
In this tutorial:
17+
In this tutorial:
1818

19-
> [!div class="checklist"]
20-
> * Register a web API in a tenant
21-
> * Record the web API's unique identifiers
22-
> * Expose an API by adding a scope
19+
> [!div class="checklist"]
20+
> * Register a web API in a tenant
21+
> * Record the web API's unique identifiers
22+
> * Expose an API by adding a scope
2323
24-
## Prerequisites
24+
## Prerequisites
2525

26-
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
27-
* This Azure account must have permissions to manage applications. Use any of the following roles needed to register the application:
28-
* Application administrator
29-
* Application developer
26+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
27+
* This Azure account must have permissions to manage applications. Use any of the following roles needed to register the application:
28+
* Application administrator
29+
* Application developer
3030
* Cloud application administrator
3131

32-
## Register the application and record identifiers
32+
## Register the application and record identifiers
3333

34-
To complete registration, provide the application a name and specify the supported account types. Once registered, the application **Overview** page will display the identifiers needed in the application source code.
34+
To complete registration, provide the application a name and specify the supported account types. Once registered, the application **Overview** page will display the identifiers needed in the application source code.
3535

36-
1. Sign in to the [Azure portal](https://portal.azure.com/).
37-
1. If access to multiple tenants is available, use the **Directories + subscriptions** filter :::image type="icon" source="media/common/portal-directory-subscription-filter.png" border="false"::: in the top menu to switch to the tenant in which you want to register the application.
38-
1. Search for and select **Azure Active Directory**.
39-
1. Under **Manage**, select **App registrations > New registration**.
40-
1. Enter a **Name** for the application, such as *NewWebAPI1*.
41-
1. For **Supported account types**, select **Accounts in this organizational directory only**. For information on different account types, select **Help me choose** option.
42-
1. Select **Register**.
36+
1. Sign in to the [Azure portal](https://portal.azure.com/).
37+
1. If access to multiple tenants is available, use the **Directories + subscriptions** filter :::image type="icon" source="media/common/portal-directory-subscription-filter.png" border="false"::: in the top menu to switch to the tenant in which you want to register the application.
38+
1. Search for and select **Azure Active Directory**.
39+
1. Under **Manage**, select **App registrations > New registration**.
40+
1. Enter a **Name** for the application, such as *NewWebAPI1*.
41+
1. For **Supported account types**, select **Accounts in this organizational directory only**. For information on different account types, select **Help me choose** option.
42+
1. Select **Register**.
4343

44-
:::image type="content" source="./media/web-api-tutorial-01-register-app/register-application.png" alt-text="Screenshot that shows how to enter a name and select the account type.":::
44+
:::image type="content" source="./media/web-api-tutorial-01-register-app/register-application.png" alt-text="Screenshot that shows how to enter a name and select the account type.":::
4545

46-
1. The application's **Overview** pane is displayed when registration is complete. Record the **Directory (tenant) ID** and the **Application (client) ID** to be used in your application source code.
46+
1. The application's **Overview** pane is displayed when registration is complete. Record the **Directory (tenant) ID** and the **Application (client) ID** to be used in your application source code.
4747

48-
:::image type="content" source="./media/web-api-tutorial-01-register-app/record-identifiers.png" alt-text="Screenshot that shows the identifier values on the overview page.":::
48+
:::image type="content" source="./media/web-api-tutorial-01-register-app/record-identifiers.png" alt-text="Screenshot that shows the identifier values on the overview page.":::
4949

5050
>[!NOTE]
5151
> The **Supported account types** can be changed by referring to [Modify the accounts supported by an application](howto-modify-supported-accounts.md).
5252
53-
## Expose an API
53+
## Expose an API
5454

5555
Once the API is registered, you can configure its permission by defining the scopes that the API exposes to client applications. Client applications request permission to perform operations by passing an access token along with its requests to the protected web API. The web API then performs the requested operation only if the access token it receives contains the required scopes.
5656

57-
1. Under **Manage**, select **Expose an API > Add a scope**. Accept the proposed **Application ID URI** `(api://{clientId})` by selecting **Save and continue**. The `{clientId}` will be the value recorded from the **Overview** page. Then enter the following information:
58-
1. For **Scope name**, enter `Forecast.Read`.
59-
1. For **Who can consent**, ensure that the **Admins and users** option is selected.
60-
1. In the **Admin consent display name** box, enter `Read forecast data`.
61-
1. In the **Admin consent description** box, enter `Allows the application to read weather forecast data`.
62-
1. In the **User consent display name** box, enter `Read forecast data`.
63-
1. In the **User consent description** box, enter `Allows the application to read weather forecast data`.
57+
1. Under **Manage**, select **Expose an API > Add a scope**. Accept the proposed **Application ID URI** `(api://{clientId})` by selecting **Save and continue**. The `{clientId}` will be the value recorded from the **Overview** page. Then enter the following information:
58+
1. For **Scope name**, enter `Forecast.Read`.
59+
1. For **Who can consent**, ensure that the **Admins and users** option is selected.
60+
1. In the **Admin consent display name** box, enter `Read forecast data`.
61+
1. In the **Admin consent description** box, enter `Allows the application to read weather forecast data`.
62+
1. In the **User consent display name** box, enter `Read forecast data`.
63+
1. In the **User consent description** box, enter `Allows the application to read weather forecast data`.
6464
1. Ensure that the **State** is set to **Enabled**.
65-
1. Select **Add scope**. If the scope has been entered correctly, it'll be listed in the **Expose an API** pane.
65+
1. Select **Add scope**. If the scope has been entered correctly, it'll be listed in the **Expose an API** pane.
6666

67-
:::image type="content" source="./media/web-api-tutorial-01-register-app/add-a-scope-inline.png" alt-text="Screenshot that shows the field values when adding the scope to an API." lightbox="./media/web-api-tutorial-01-register-app/add-a-scope-expanded.png":::
67+
:::image type="content" source="./media/web-api-tutorial-01-register-app/add-a-scope-inline.png" alt-text="Screenshot that shows the field values when adding the scope to an API." lightbox="./media/web-api-tutorial-01-register-app/add-a-scope-expanded.png":::
6868

69-
## Next steps
69+
## Next steps
7070

71-
> [!div class="nextstepaction"]
72-
> [Tutorial: Create an ASP.NET Core project and configure the API](web-api-tutorial-02-prepare-api.md)
71+
> [!div class="nextstepaction"]
72+
> [Tutorial: Create an ASP.NET Core project and configure the API](web-api-tutorial-02-prepare-api.md)

articles/active-directory/develop/web-api-tutorial-02-prepare-api.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ ms.date: 11/1/2022
1414

1515
After registration is complete, a ASP.NET Core project can be created using an integrated development environment (IDE). This tutorial demonstrates how to create an ASP.NET Core project using an IDE and configure for authentication and authorization.
1616

17-
In this tutorial:
17+
In this tutorial:
1818

19-
> [!div class="checklist"]
19+
> [!div class="checklist"]
2020
> * Create an **ASP.NET Core Empty**
21-
> * Configure the settings for the application
22-
> * Identify and install the required NuGet packages
21+
> * Configure the settings for the application
22+
> * Identify and install the required NuGet packages
2323
24-
## Prerequisites
24+
## Prerequisites
2525

2626
* Completion of the prerequisites and steps in [Tutorial: Register web API with the Microsoft identity platform](web-api-tutorial-01-register-app.md).
27-
* You can download the IDEs used in this tutorial from the [Downloads](https://visualstudio.microsoft.com/downloads) page.
28-
- Visual Studio 2022
29-
- Visual Studio Code
30-
- Visual Studio 2022 for Mac
31-
- A minimum requirement of [.NET Core 6.0 SDK](https://dotnet.microsoft.com/download/dotnet).
27+
* You can download the IDEs used in this tutorial from the [Downloads](https://visualstudio.microsoft.com/downloads) page.
28+
- Visual Studio 2022
29+
- Visual Studio Code
30+
- Visual Studio 2022 for Mac
31+
- A minimum requirement of [.NET Core 6.0 SDK](https://dotnet.microsoft.com/download/dotnet).
3232

33-
## Create an ASP.NET Core project
33+
## Create an ASP.NET Core project
3434

35-
Use the following tabs to create an ASP.NET Core project within an IDE.
35+
Use the following tabs to create an ASP.NET Core project within an IDE.
3636

37-
### [Visual Studio](#tab/visual-studio)
37+
### [Visual Studio](#tab/visual-studio)
3838

3939
1. Open Visual Studio, and then select **Create a new project**.
4040
1. Search for and choose the **ASP.NET Core Empty** template, and then select **Next**.
@@ -43,13 +43,13 @@ Use the following tabs to create an ASP.NET Core project within an IDE.
4343
1. Accept the default for the **Framework** and **Configure for HTTPS**.
4444
1. Select **Create**.
4545

46-
### [Visual Studio Code](#tab/visual-studio-code)
46+
### [Visual Studio Code](#tab/visual-studio-code)
4747

48-
1. Open Visual Studio Code, select **File > Open Folder...**. Navigate to and select the location in which to create your project.
48+
1. Open Visual Studio Code, select **File > Open Folder...**. Navigate to and select the location in which to create your project.
4949
1. Open up a new terminal by selecting **Terminal** in the top bar, then **New Terminal**.
5050
1. Create a new folder using the **New Folder...** icon in the **Explorer** pane. Provide a name similar to the one registered previously, for example, *NewWebAPILocal*.
5151
1. Open a new terminal by selecting **Terminal > New Terminal**.
52-
1. To create an **ASP.NET Core Empty** template, run the following commands in the terminal to change into the directory and create the project:
52+
1. To create an **ASP.NET Core Empty** template, run the following commands in the terminal to change into the directory and create the project:
5353

5454
```powershell
5555
cd NewWebAPILocal
@@ -70,7 +70,7 @@ Use the following tabs to create an ASP.NET Core project within an IDE.
7070
7171
The values recorded earlier will be used in *appsettings.json* to configure the application for authentication. *appsettings.json* is a configuration file that is used to store application settings used during run-time.
7272
73-
1. Open *appsettings.json* and replace the file contents with the following code snippet:
73+
1. Open *appsettings.json* and replace the file contents with the following code snippet:
7474
7575
```json
7676
{
@@ -102,25 +102,24 @@ Identity related **NuGet packages** must be installed in the project for authent
102102
103103
### [Visual Studio](#tab/visual-studio)
104104
105-
1. In the top menu, select **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution**.
106-
1. With the **Browse** tab selected, search for **Microsoft.Identity.Web**, select the `Microsoft.Identity.Web` package, select the **Project** checkbox, and then select **Install**.
107-
1. Select **Ok** or **I Accept** for other windows that may appear.
105+
1. In the top menu, select **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution**.
106+
1. With the **Browse** tab selected, search for **Microsoft.Identity.Web**, select the `Microsoft.Identity.Web` package, select the **Project** checkbox, and then select **Install**.
107+
1. Select **Ok** or **I Accept** for other windows that may appear.
108108
109-
### [Visual Studio Code](#tab/visual-studio-code)
109+
### [Visual Studio Code](#tab/visual-studio-code)
110110
111-
1. In the terminal opened in the previous section, enter the following command:
111+
1. In the terminal opened in the previous section, enter the following command:
112112
113113
```powershell
114-
dotnet add package Microsoft.Identity.Web
114+
dotnet add package Microsoft.Identity.Web
115115
```
116116
117-
### [Visual Studio for Mac](#tab/visual-studio-for-mac)
117+
### [Visual Studio for Mac](#tab/visual-studio-for-mac)
118118
119-
1. In the top menu, select **Tools** > **Manage NuGet Packages**.
120-
1. Search for **Microsoft.Identity.Web**, select the `Microsoft.Identity.Web` package, select **Project**, and then select **Add Package**.
121-
1. Modify the search to **Microsoft.Identity.Web.UI** and select **Add Packages**.
122-
1. In the pop-up, ensure the correct project is selected, then select **Ok**.
123-
1. Select **Accept** if other **License Acceptance** windows appear.
119+
1. In the top menu, select **Tools** > **Manage NuGet Packages**.
120+
1. Search for **Microsoft.Identity.Web**, select the `Microsoft.Identity.Web` package, select **Project**, and then select **Add Package**.
121+
1. In the pop-up, ensure the correct project is selected, then select **Ok**.
122+
1. Select **Accept** if other **License Acceptance** windows appear.
124123
125124
---
126125

articles/active-directory/develop/web-api-tutorial-03-protect-endpoint.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ ms.service: active-directory
88
ms.topic: tutorial
99
ms.date: 11/1/2022
1010
#Customer intent: As an application developer I want to protect the endpoint of my API and run it to ensure it is listening for HTTP requests
11-
#TBD
1211
---
1312

14-
# Tutorial: Implement a protected endpoint to your API
13+
# Tutorial: Implement a protected endpoint to your API
1514

16-
Protecting an API endpoint ensures that only authorized users are permitted access. The Microsoft identity platform provides a way to protect API endpoints by using the [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web/) NuGet package.
15+
Protecting an API endpoint ensures that only authorized users are permitted access. The Microsoft identity platform provides a way to protect API endpoints by using the [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web/) NuGet package.
1716

1817
In this tutorial:
1918

20-
> [!div class="checklist"]
21-
> * Implement authentication
22-
> * Add weather information for the API to display
23-
> * Test the API with an unauthenticated GET request
19+
> [!div class="checklist"]
20+
> * Implement authentication
21+
> * Add weather information for the API to display
22+
> * Test the API with an unauthenticated GET request
2423
25-
## Prerequisites
24+
## Prerequisites
2625

2726
* Completion of the prerequisites and steps in [Tutorial: Create and configure an ASP.NET Core project for authentication](web-api-tutorial-02-prepare-api.md).
2827

2928
## Implement authorization
3029

31-
1. Open the *Program.cs* file and replace the contents with the following snippet:
30+
1. Open the *Program.cs* file and replace the contents with the following snippet:
3231

3332
```csharp
3433
using Microsoft.AspNetCore.Authentication.JwtBearer;
@@ -101,19 +100,20 @@ In this tutorial:
101100
}
102101
```
103102

104-
## Test the application
103+
## Test the application
105104

106-
### [Visual Studio](#tab/visual-studio)
105+
### [Visual Studio](#tab/visual-studio)
107106

108-
1. In Visual Studio, select **Start without debugging**.
107+
1. In Visual Studio, select **Start without debugging**.
109108

110-
### [Visual Studio Code](#tab/visual-studio-code)
109+
### [Visual Studio Code](#tab/visual-studio-code)
111110

112-
1. Start the application by typing the following in the terminal:
111+
1. Start the application by typing the following in the terminal:
113112

114-
```powershell
115-
dotnet run
113+
```powershell
114+
dotnet run
116115
```
116+
117117
1. A similar output to the following should be displayed in the terminal. This confirms that the application is running on `http://localhost:{port}` and listening for requests.
118118
119119
```powershell
@@ -122,19 +122,19 @@ In this tutorial:
122122
Now listening on: http://localhost:{port}
123123
info: Microsoft.Hosting.Lifetime[0]
124124
Application started. Press Ctrl+C to shut down.
125-
...
125+
...
126126
```
127127

128-
### [Visual Studio for Mac](#tab/visual-studio-for-mac)
128+
### [Visual Studio for Mac](#tab/visual-studio-for-mac)
129129

130-
1. Start the application by selecting **Play the executing solution**.
130+
1. Start the application by selecting **Play the executing solution**.
131131
---
132132

133-
The web page `http://localhost:{host}` displays an output similar to the following image. This is because the API is being called without authentication. In order to make an authorized call, refer to [Next steps](#next-steps) for how-to guides on how to access a protected web API.
133+
The web page `http://localhost:{host}` displays an output similar to the following image. This is because the API is being called without authentication. In order to make an authorized call, refer to [Next steps](#next-steps) for how-to guides on how to access a protected web API.
134134
135-
:::image type="content" source="./media/web-api-tutorial-03-protect-endpoint/display-web-page-401.png" alt-text="Screenshot that shows the 401 error when the web page is launched.":::
135+
:::image type="content" source="./media/web-api-tutorial-03-protect-endpoint/display-web-page-401.png" alt-text="Screenshot that shows the 401 error when the web page is launched.":::
136136

137-
## Next steps
137+
## Next steps
138138

139139
> [!div class="nextstepaction"]
140140
>

0 commit comments

Comments
 (0)