Skip to content

Commit 7870718

Browse files
Copilotmeaghanlewiswadepickett
authored
Document AddIdentityCore as prerequisite for ConfigureApplicationCookie (#36803)
* Initial plan * Document AddIdentityCore dependency for ConfigureApplicationCookie Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com> Co-authored-by: Meaghan Osagie (Lewis) <mosagie@microsoft.com> Co-authored-by: Wade Pickett <wpickett@microsoft.com>
1 parent 7a4b4e9 commit 7870718

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

0 commit comments

Comments
 (0)