From 9b2ef8e8df810f4f5fb7be4ad61c83bb8931eae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Fri, 31 Jul 2026 19:04:15 +0200 Subject: [PATCH] Do not require login identifiers attached to OpenIddict sessions to be unique --- .../OpenIddictEntityFrameworkSessionConfiguration.cs | 3 --- .../OpenIddictEntityFrameworkCoreSessionConfiguration.cs | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/OpenIddict.EntityFramework/Configurations/OpenIddictEntityFrameworkSessionConfiguration.cs b/src/OpenIddict.EntityFramework/Configurations/OpenIddictEntityFrameworkSessionConfiguration.cs index 01924a1d..0acaf704 100644 --- a/src/OpenIddict.EntityFramework/Configurations/OpenIddictEntityFrameworkSessionConfiguration.cs +++ b/src/OpenIddict.EntityFramework/Configurations/OpenIddictEntityFrameworkSessionConfiguration.cs @@ -58,9 +58,6 @@ public sealed class OpenIddictEntityFrameworkSessionConfiguration< Property(static session => session.LoginId) .HasMaxLength(100); - // Warning: the index on the LoginId property MUST NOT be declared as - // a unique index, as Entity Framework 6.x doesn't support creating indexes - // with null-friendly WHERE conditions, unlike Entity Framework Core. HasIndex(static session => session.LoginId); Property(static session => session.Status) diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictEntityFrameworkCoreSessionConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictEntityFrameworkCoreSessionConfiguration.cs index e5e5e785..39697fbe 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictEntityFrameworkCoreSessionConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictEntityFrameworkCoreSessionConfiguration.cs @@ -60,8 +60,7 @@ public sealed class OpenIddictEntityFrameworkCoreSessionConfiguration< builder.Property(static session => session.LoginId) .HasMaxLength(100); - builder.HasIndex(static session => session.LoginId) - .IsUnique(); + builder.HasIndex(static session => session.LoginId); builder.Property(static session => session.Status) .HasMaxLength(50);