diff --git a/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs b/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs index 22d04941..120b2d11 100644 --- a/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs +++ b/Oqtane.Server/Extensions/OqtaneServiceCollectionExtensions.cs @@ -121,8 +121,10 @@ namespace Microsoft.Extensions.DependencyInjection public static IServiceCollection ConfigureOqtaneCookieOptions(this IServiceCollection services) { + // note that ConfigureApplicationCookie internally uses an ApplicationScheme of "Identity.Application" services.ConfigureApplicationCookie(options => { + options.Cookie.Domain = "localhost"; options.Cookie.HttpOnly = false; options.Cookie.SameSite = SameSiteMode.Strict; options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; diff --git a/Oqtane.Server/Pages/Login.cshtml.cs b/Oqtane.Server/Pages/Login.cshtml.cs index faf1989c..87fceedb 100644 --- a/Oqtane.Server/Pages/Login.cshtml.cs +++ b/Oqtane.Server/Pages/Login.cshtml.cs @@ -46,6 +46,7 @@ namespace Oqtane.Pages if (validuser) { + // note that .NET Identity uses a hardcoded ApplicationScheme of "Identity.Application" in SignInAsync await _identitySignInManager.SignInAsync(identityuser, remember); } } diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index 9e008722..8277c378 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -115,9 +115,7 @@ namespace Oqtane services.AddAuthentication(options => { - options.DefaultAuthenticateScheme = Constants.AuthenticationScheme; - options.DefaultChallengeScheme = Constants.AuthenticationScheme; - options.DefaultSignOutScheme = Constants.AuthenticationScheme; + options.DefaultScheme = Constants.AuthenticationScheme; }) .AddCookie(Constants.AuthenticationScheme) .AddOpenIdConnect(AuthenticationProviderTypes.OpenIDConnect, options => { })