Skip to content

Commit 31995f1

Browse files
authored
Merge pull request #36815 from dotnet/main
Merge to Live
2 parents de1d8f6 + 3c38262 commit 31995f1

File tree

12 files changed

+32
-53
lines changed

12 files changed

+32
-53
lines changed

aspnetcore/security/authentication/identity-configuration.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
title: Configure ASP.NET Core Identity
3+
ai-usage: ai-assisted
34
author: AdrienTorris
45
description: Understand ASP.NET Core Identity default values and learn how to configure Identity properties to use custom values.
56
ms.author: tdykstra
67
monikerRange: '>= aspnetcore-3.1'
78
ms.custom: mvc
8-
ms.date: 3/09/2024
9+
ms.date: 02/24/2026
910
uid: security/authentication/identity-configuration
1011
---
1112
# Configure ASP.NET Core Identity
@@ -119,7 +120,7 @@ The following code sets `SignIn` settings (to default values):
119120

120121
### Cookie settings
121122

122-
Configure the app's cookie in `Program.cs`. [ConfigureApplicationCookie](xref:Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.ConfigureApplicationCookie(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions})) must be called **after** calling `AddIdentity` or `AddDefaultIdentity`.
123+
Configure the app's cookie in `Program.cs`. [ConfigureApplicationCookie](xref:Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.ConfigureApplicationCookie(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions})) must be called **after** calling `AddIdentityCore`, `AddIdentity`, or `AddDefaultIdentity`.
123124

124125
[!code-csharp[](identity-configuration/sample6/RPauth/Program.cs?name=snippet_cookie)]
125126

@@ -267,7 +268,7 @@ The following code sets `SignIn` settings (to default values):
267268

268269
### Cookie settings
269270

270-
Configure the app's cookie in `Startup.ConfigureServices`. [ConfigureApplicationCookie](xref:Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.ConfigureApplicationCookie(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions})) must be called **after** calling `AddIdentity` or `AddDefaultIdentity`.
271+
Configure the app's cookie in `Startup.ConfigureServices`. [ConfigureApplicationCookie](xref:Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionExtensions.ConfigureApplicationCookie(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationOptions})) must be called **after** calling `AddIdentityCore`, `AddIdentity`, or `AddDefaultIdentity`.
271272

272273
[!code-csharp[](identity-configuration/sample/Startup.cs?name=snippet_cookie)]
273274

aspnetcore/security/authentication/social/facebook-logins.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,39 @@
11
---
22
title: Facebook external login setup in ASP.NET Core
3+
ai-usage: ai-assisted
34
author: wadepickett
45
description: Tutorial with code examples demonstrating the integration of Facebook account user authentication into an existing ASP.NET Core app.
5-
ms.author: wpickett
6-
ms.custom: mvc, sfi-image-nochange
7-
ms.date: 12/08/2021
86
monikerRange: '>= aspnetcore-3.0'
7+
ms.author: wpickett
8+
ms.custom: mvc
9+
ms.date: 02/27/2026
910
uid: security/authentication/facebook-logins
1011
---
1112

1213
# Facebook external login setup in ASP.NET Core
1314

1415
By [Valeriy Novytskyy](https://github.com/01binary) and [Rick Anderson](https://twitter.com/RickAndMSFT)
1516

16-
<!-- per @rick-anderson and scott addie, don't update images. Remove images and point the customer to the FB set up page. FB needs to maintain instructions to get key and secret.
17-
-->
18-
19-
This tutorial with code examples shows how to enable your users to sign in with their Facebook account using a sample ASP.NET Core project created on the [previous page](xref:security/authentication/social/index). We start by creating a Facebook App ID by following the [official steps](https://developers.facebook.com).
17+
This tutorial with code examples shows how to enable your users to sign in with their Facebook account using a sample ASP.NET Core project created on the [previous page](xref:security/authentication/social/index).
2018

2119
## Create the app in Facebook
2220

2321
* Add the [Microsoft.AspNetCore.Authentication.Facebook](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook) NuGet package to the project.
2422

25-
* Navigate to the [Facebook Developers app](https://developers.facebook.com/apps/) page and sign in. If you don't already have a Facebook account, use the **Sign up for Facebook** link on the login page to create one. Once you have a Facebook account, follow the instructions to register as a Facebook Developer.
26-
27-
* From the **My Apps** menu select **Create App**. The **Create an app** form appears.
28-
![Facebook for developers portal open in Microsoft Edge](index/_static/FBMyApps.png)
29-
30-
* Select an app type that best fits your project. For this project, select **Consumer**, and then **Next**. A new App ID is created.
31-
32-
* Fill out the form and tap the **Create App** button.
33-
34-
![Create a New App ID form](index/_static/FBNewAppId.png)
23+
* Follow the [Facebook App Registration](https://developers.facebook.com/docs/apps/register) instructions to create a Facebook app and obtain your **App ID** and **App Secret**.
3524

36-
* On the **Add Products to Your App** page, select **Set Up** on the **Facebook Login** card.
25+
* Follow the [Facebook Login for Web](https://developers.facebook.com/docs/facebook-login/web) instructions to configure Facebook Login for your app. Add your development URI with */signin-facebook* appended (for example: `https://localhost:44320/signin-facebook`) to the **Valid OAuth Redirect URIs**.
3726

38-
![Product Setup page](index/_static/FBProductSetup.png)
39-
40-
* The **Quickstart** wizard launches with **Choose a Platform** as the first page. Bypass the wizard for now by clicking the **FaceBook Login** **Settings** link in the menu on the lower left:
41-
42-
![Skip Quick Start](index/_static/FBSkipQuickStart.png)
43-
44-
* The **Client OAuth Settings** page is presented:
45-
46-
![Client OAuth Settings page](index/_static/FBOAuthSetup.png)
47-
48-
* Enter your development URI with */signin-facebook* appended into the **Valid OAuth Redirect URIs** field (for example: `https://localhost:44320/signin-facebook`). The Facebook authentication configured later in this tutorial will automatically handle requests at */signin-facebook* route to implement the OAuth flow.
27+
The Facebook authentication configured later in this tutorial automatically handles requests at the */signin-facebook* route to implement the OAuth flow.
4928

5029
> [!NOTE]
5130
> The URI */signin-facebook* is set as the default callback of the Facebook authentication provider. You can change the default callback URI while configuring the Facebook authentication middleware via the inherited <xref:Microsoft.AspNetCore.Authentication.RemoteAuthenticationOptions.CallbackPath%2A?displayProperty=nameWithType> property of the <xref:Microsoft.AspNetCore.Authentication.Facebook.FacebookOptions> class.
5231
53-
* Select **Save Changes**.
54-
55-
* Select **Settings** > **Basic** link in the left navigation.
32+
* Follow the [Facebook Login Permissions](https://developers.facebook.com/docs/facebook-login/permissions) guide to enable the **email** permission for your app. The ASP.NET Core Facebook authentication middleware requests the `email` scope by default. If the **email** permission isn't enabled on your Facebook app, authentication may fail or the user's email address will be missing after sign-in.
5633

57-
* Make a note of your `App ID` and your `App Secret`. You will add both into your ASP.NET Core application in the next section:
34+
* Make a note of your **App ID** and **App Secret**. You add both into your ASP.NET Core application in the next section.
5835

59-
* When deploying the site you need to revisit the **Facebook Login** setup page, and register a new public URI.
36+
* When deploying the site, revisit the **Facebook Login** setup page and register a new public URI.
6037

6138
## Store the Facebook app ID and secret
6239

@@ -106,7 +83,7 @@ Add the Authentication service to the `Program`:
10683
* Enter your Facebook credentials.
10784
* You are redirected back to your site where you can set your email.
10885

109-
You are now logged in using your Facebook credentials:
86+
You are now logged in using your Facebook credentials.
11087

11188
<a name="react"></a>
11289

@@ -143,6 +120,7 @@ For more information on configuration options supported by Facebook authenticati
143120

144121
* **ASP.NET Core 2.x only:** If Identity isn't configured by calling `services.AddIdentity` in `ConfigureServices`, attempting to authenticate will result in *ArgumentException: The 'SignInScheme' option must be provided*. The project template used in this tutorial ensures that this is done.
145122
* If the site database has not been created by applying the initial migration, you get *A database operation failed while processing the request* error. Tap **Apply Migrations** to create the database and refresh to continue past the error.
123+
* If you receive an error during Facebook sign-in or the user's email address is missing after sign-in, verify that the **email** permission is enabled for your Facebook app. See the [Facebook Login Permissions](https://developers.facebook.com/docs/facebook-login/permissions) guide for details on enabling permissions in the Facebook Developer portal.
146124

147125
## Next steps
148126

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

aspnetcore/tutorials/first-mvc-app/new-field.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: Part 8, add a new field to an ASP.NET Core MVC app
3+
ai-usage: ai-assisted
34
author: wadepickett
45
description: Part 8 of tutorial series on ASP.NET Core MVC.
56
monikerRange: '>= aspnetcore-3.1'
67
ms.author: wpickett
7-
ms.date: 01/22/2026
8+
ms.date: 02/24/2026
89
uid: tutorials/first-mvc-app/new-field
910
---
1011
# Part 8, add a new field to an ASP.NET Core MVC app
@@ -66,7 +67,9 @@ You can copy/paste the previous "form group" and let intelliSense help you updat
6667

6768
# [Visual Studio Code](#tab/visual-studio-code)
6869

69-
:::image type="content" source="~/tutorials/first-mvc-app/new-field/media/vscode-update-form.png" alt-text="Updating the existed form by inserting the new field Rating.":::
70+
You can copy/paste the previous "form group" and let IntelliSense help you update the fields. IntelliSense works with [Tag Helpers](xref:mvc/views/tag-helpers/intro). The [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) extension provides IntelliSense support in Visual Studio Code.
71+
72+
:::image type="content" source="~/tutorials/first-mvc-app/new-field/media/vscode-update-form.png" alt-text="Updating the existing form by inserting the new field Rating.":::
7073

7174
---
7275

aspnetcore/tutorials/first-mvc-app/new-field/includes/new-field8.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ You can copy/paste the previous "form group" and let intelliSense help you updat
5454

5555
# [Visual Studio Code](#tab/visual-studio-code)
5656

57-
![Updating the existed form by inserting the new field "Rating".](~/tutorials/first-mvc-app/new-field/_static/VSCode-UpdatingForm.png)
57+
You can copy/paste the previous "form group" and let IntelliSense help you update the fields. IntelliSense works with [Tag Helpers](xref:mvc/views/tag-helpers/intro). The [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) extension provides IntelliSense support in Visual Studio Code.
58+
59+
![Updating the existing form by inserting the new field "Rating".](~/tutorials/first-mvc-app/new-field/_static/VSCode-UpdatingForm.png)
5860

5961
---
6062

0 commit comments

Comments
 (0)