Asp.Net Core Mvc项目登录IdentityServer4验证无法跳转问题

2021/8/1 9:06:04

本文主要是介绍Asp.Net Core Mvc项目登录IdentityServer4验证无法跳转问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Asp.Net Core Mvc项目连接IdentityServer4项目,输入账号密码验证后,无法跳转到MVC项目。

 

 停留在 http://localhost:5001/Account/Login?ReturnUrl 这个界面,不跳转

解决方法:IdentityServer4项目中Startup类中

 public void ConfigureServices(IServiceCollection services)

这个方法中添加如下代码:

  services.AddAuthentication(options =>
            {
                options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            }).AddCookie("Cookies");

 



这篇关于Asp.Net Core Mvc项目登录IdentityServer4验证无法跳转问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程