set DefaultScheme for authentication
This commit is contained in:
@ -121,8 +121,10 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
|
|
||||||
public static IServiceCollection ConfigureOqtaneCookieOptions(this IServiceCollection services)
|
public static IServiceCollection ConfigureOqtaneCookieOptions(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
// note that ConfigureApplicationCookie internally uses an ApplicationScheme of "Identity.Application"
|
||||||
services.ConfigureApplicationCookie(options =>
|
services.ConfigureApplicationCookie(options =>
|
||||||
{
|
{
|
||||||
|
options.Cookie.Domain = "localhost";
|
||||||
options.Cookie.HttpOnly = false;
|
options.Cookie.HttpOnly = false;
|
||||||
options.Cookie.SameSite = SameSiteMode.Strict;
|
options.Cookie.SameSite = SameSiteMode.Strict;
|
||||||
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
|
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
|
||||||
|
@ -46,6 +46,7 @@ namespace Oqtane.Pages
|
|||||||
|
|
||||||
if (validuser)
|
if (validuser)
|
||||||
{
|
{
|
||||||
|
// note that .NET Identity uses a hardcoded ApplicationScheme of "Identity.Application" in SignInAsync
|
||||||
await _identitySignInManager.SignInAsync(identityuser, remember);
|
await _identitySignInManager.SignInAsync(identityuser, remember);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,9 +115,7 @@ namespace Oqtane
|
|||||||
|
|
||||||
services.AddAuthentication(options =>
|
services.AddAuthentication(options =>
|
||||||
{
|
{
|
||||||
options.DefaultAuthenticateScheme = Constants.AuthenticationScheme;
|
options.DefaultScheme = Constants.AuthenticationScheme;
|
||||||
options.DefaultChallengeScheme = Constants.AuthenticationScheme;
|
|
||||||
options.DefaultSignOutScheme = Constants.AuthenticationScheme;
|
|
||||||
})
|
})
|
||||||
.AddCookie(Constants.AuthenticationScheme)
|
.AddCookie(Constants.AuthenticationScheme)
|
||||||
.AddOpenIdConnect(AuthenticationProviderTypes.OpenIDConnect, options => { })
|
.AddOpenIdConnect(AuthenticationProviderTypes.OpenIDConnect, options => { })
|
||||||
|
Reference in New Issue
Block a user