日志中出现下面的 OpenIdConnect 相关的警告,请问如何解决这个问题?
2023-03-21 07:06:48.349 [Warning] The cookie '".AspNetCore.OpenIdConnect.******"' has set 'SameSite=None' and must also set 'Secure'
添加下面的 cookie 设置后解决了
services.AddCnblogsAuthentication()
.AddOpenIdConnect(options =>
{
options.NonceCookie.SecurePolicy = CookieSecurePolicy.Always;
options.CorrelationCookie.SecurePolicy = CookieSecurePolicy.Always;
});
参考:The cookie '.AspNetCore.Identity.Application' has set 'SameSite=None' and must also set 'Secure'