关于支付宝浏览器身份验证失效,无法登录。
我设置了CheckConsentNeeded:false
并且身份验证 IsEssential :true
但都在支付宝浏览器无法登录,错误日志是 :AuthenticationScheme: Cookies was not authenticated.
@dudu
public void ConfigureServices (IServiceCollection services) {
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => false;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(option => {
option.LoginPath = new PathString("/Visitor/login");
option.AccessDeniedPath = new PathString("/Visitor/Logout");
option.Cookie.Path = "/";
option.Cookie.HttpOnly = true;
option.Cookie.IsEssential = true;
});
}
public void Configure (IApplicationBuilder app, IWebHostEnvironment env) {
if (env.IsDevelopment()) {
app.UseDeveloperExceptionPage();
} else {
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
LogManager.LoadConfiguration("nlog.config");
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints => {
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=visitor}/{action=index}/{id?}");
});
app.UseWxPayment();
}
相关问题
- aspnetcore 在docker中运行端口映射问题
- aspnetcore 3.1 mvc 身份验证 支付宝浏览器失效 无法登录
- error MSB4041: 项目的默认 XML 命名空间必须为 MSBuild XML 命名空间
- 在docker run中动态传递参数的问题
- linux docker aspnetcore X509Certificate2 加载证书
我们设置了
没有设置