diff --git a/aspnetcore/security/authentication/social/microsoft-logins.md b/aspnetcore/security/authentication/social/microsoft-logins.md index 565cc831b3..6a13caf910 100644 --- a/aspnetcore/security/authentication/social/microsoft-logins.md +++ b/aspnetcore/security/authentication/social/microsoft-logins.md @@ -78,6 +78,10 @@ The project template used in this tutorial ensures that [Microsoft.AspNetCore.Au Add the Microsoft Account service in the `ConfigureServices` method in *Startup.cs* file: ```csharp +services.AddIdentity() + .AddEntityFrameworkStores() + .AddDefaultTokenProviders(); + services.AddAuthentication().AddMicrosoftAccount(microsoftOptions => { microsoftOptions.ClientId = Configuration["Authentication:Microsoft:ApplicationId"]; @@ -85,6 +89,8 @@ services.AddAuthentication().AddMicrosoftAccount(microsoftOptions => }); ``` +**Note:** The call to `AddIdentity` configures the default settings. The `AddAuthentication(string defaultScheme)` overload sets the `DefaultScheme` property; and, the `AddAuthentication(Action configureOptions)` overload sets only the properties you explicitly set. Either of these overloads should only be called once when adding multiple authentication providers. Subsequent calls to it have the potential of overriding any previously configured [AuthenticationOptions](https://docs.microsoft.com/aspnet/core/api/microsoft.aspnetcore.builder.authenticationoptions) properties. + # [ASP.NET Core 1.x](#tab/aspnetcore1x) Add the Microsoft Account middleware in the `Configure` method in *Startup.cs* file: