Skip to content

Commit 6ea91f7

Browse files
jmprieurmmacy
andauthored
Apply suggestions from code review
Commiting @mmacy 's suggestions Co-Authored-By: Marsh Macy <[email protected]>
1 parent 452203d commit 6ea91f7

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

articles/active-directory/develop/scenario-web-app-call-api-acquire-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ms.custom: aaddev
1919

2020
You've built your client application object. Now, you'll use it to acquire a token to call a web API. In ASP.NET or ASP.NET Core, calling a web API is done in the controller:
2121

22-
- Get a token for the web API by using the token cache. To get this token, you call the MSAL `AcquireTokenSilent` method (or the equivalent in Microsoft.IdentityWeb).
22+
- Get a token for the web API by using the token cache. To get this token, you call the MSAL `AcquireTokenSilent` method (or the equivalent in Microsoft.Identity.Web).
2323
- Call the protected API, passing the access token to it as a parameter.
2424

2525
# [ASP.NET Core](#tab/aspnetcore)

articles/active-directory/develop/scenario-web-app-sign-user-app-configuration.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,18 @@ The initialization code is different depending on the platform. For ASP.NET Core
203203
204204
# [ASP.NET Core](#tab/aspnetcore)
205205
206-
In ASP.NET Core web apps (and web APIs), the application is protected because you have a `[Authorize]` attribute on the controllers or the controller actions. This attribute checks that the user is authenticated. The code that's initializing the application is in the `Startup.cs` file.
206+
In ASP.NET Core web apps (and web APIs), the application is protected because you have a `[Authorize]` attribute on the controllers or the controller actions. This attribute checks that the user is authenticated. The code that's initializing the application is in the *Startup.cs* file.
207207
208208
To add authentication with the Microsoft identity platform (formerly Azure AD v2.0), you'll need to add the following code. The comments in the code should be self-explanatory.
209209
210210
> [!NOTE]
211-
> If you start your project with the default ASP.NET Core web project within Visual studio or by using `dotnet new mvc --auth SingleAuth` or `dotnet new webapp --auth SingleAuth`, you'll see code like the following: `services.AddAuthentication(AzureADDefaults.AuthenticationScheme).AddAzureAD(options => Configuration.Bind("AzureAd", options));`.
211+
> If you start your project with the default ASP.NET Core web project within Visual Studio or by using `dotnet new mvc --auth SingleAuth` or `dotnet new webapp --auth SingleAuth`, you'll see code like the following: `services.AddAuthentication(AzureADDefaults.AuthenticationScheme).AddAzureAD(options => Configuration.Bind("AzureAd", options));`.
212212
>
213-
> This code uses the legacy **Microsoft.AspNetCore.Authentication.AzureAD.UI** NuGet package which is used to create an Azure AD v1.0 application. This article explains how to create a Microsoft identity platform (Azure AD v2.0) application, in which that code is replaced
213+
> This code uses the legacy **Microsoft.AspNetCore.Authentication.AzureAD.UI** NuGet package which is used to create an Azure AD v1.0 application. This article explains how to create a Microsoft identity platform (Azure AD v2.0) application which replaces that code.
214214
215-
1. Add the following NuGet packages [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web) and [Microsoft.Identity.Web.UI](https://www.nuget.org/packages/Microsoft.Identity.Web.UI) to your project. You can also remove the Microsoft.AspNetCore.Authentication.AzureAD.UI NuGet package if it's present.
215+
1. Add the [Microsoft.Identity.Web](https://www.nuget.org/packages/Microsoft.Identity.Web) and [Microsoft.Identity.Web.UI](https://www.nuget.org/packages/Microsoft.Identity.Web.UI) NuGet packages to your project. Remove the Microsoft.AspNetCore.Authentication.AzureAD.UI NuGet package if it's present.
216216
217-
2. Update the code in `ConfigureServices` so that it uses the `AddSignIn` and the `AddMicrosoftIdentityUI` methods
217+
2. Update the code in `ConfigureServices` so that it uses the `AddSignIn` and `AddMicrosoftIdentityUI` methods.
218218
219219
```c#
220220
public class Startup
@@ -234,7 +234,7 @@ To add authentication with the Microsoft identity platform (formerly Azure AD v2
234234
}).AddMicrosoftIdentityUI();
235235
```
236236
237-
3. Make sure that the `Configure` method in `Startup.cs` enables authentication by a call to `app.UseAuthentication();`
237+
3. In the `Configure` method in *Startup.cs*, enable authentication with a call to `app.UseAuthentication();`
238238
239239
```c#
240240
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -248,18 +248,18 @@ To add authentication with the Microsoft identity platform (formerly Azure AD v2
248248
```
249249
250250
In the code above:
251-
- the `AddSignIn` extension method is defined in **Microsoft.Identity.Web**. It:
251+
- The `AddSignIn` extension method is defined in **Microsoft.Identity.Web**. It:
252252
- Adds the authentication service.
253253
- Configures options to read the configuration file (here from the "AzureAD" section)
254-
- Configures the OpenID Connect options so that the used authority is the Microsoft identity platform (formerly Azure AD v2.0) endpoint.
254+
- Configures the OpenID Connect options so that the authority is the Microsoft identity platform endpoint.
255255
- Validates the issuer of the token.
256256
- Ensures that the claims corresponding to name are mapped from the `preferred_username` claim in the ID token.
257257
258258
- In addition to the configuration object, you can specify the name of the configuration section when calling `AddSignIn`. By default, it's `AzureAd`.
259259
260-
- `AddSignIn` has other parameters for advanced scenarios. For instance, tracing OpenId Connect middleware events can help you troubleshoot your web application if authentication doesn't work. Setting the optional parameter `subscribeToOpenIdConnectMiddlewareDiagnosticsEvents` to `true` will show you how information gets elaborated by the set of ASP.NET Core middleware as it progresses from the HTTP response to the identity of the user in `HttpContext.User`.
260+
- `AddSignIn` has other parameters for advanced scenarios. For example, tracing OpenID Connect middleware events can help you troubleshoot your web application if authentication doesn't work. Setting the optional parameter `subscribeToOpenIdConnectMiddlewareDiagnosticsEvents` to `true` will show you how information is processed by the set of ASP.NET Core middleware as it progresses from the HTTP response to the identity of the user in `HttpContext.User`.
261261
262-
- The `AddMicrosoftIdentityUI` extension method is defined in **Microsoft.Identity.Web.UI**. It provides some default controller to handle sign-out
262+
- The `AddMicrosoftIdentityUI` extension method is defined in **Microsoft.Identity.Web.UI**. It provides a default controller to handle sign-out.
263263
264264
# [ASP.NET](#tab/aspnet)
265265

0 commit comments

Comments
 (0)