在asp.net core 2.0中使用identityserver4时的无限认证循环
我有一个使用identityserver4框架的Identity Server,它的url是
http://localhost:9000
我的Web应用程序是asp.net core 2.0,其URL是http://localhost:60002.此应用程序将使用Identity Server的登录页面. 我希望登录后,Identity Server将重定向到应用程序页面(http://localhost:60002) 这是客户端应用程序的Startup.cs Startup.cs public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } private string AuthorityUri => Configuration.GetValue<string>("UserManagement-Authority"); // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); services.AddAuthentication(options => { options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; }) .AddCookie() .AddOpenIdConnect(options => { options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.Authority = AuthorityUri; // "http://localhost:9000" options.RequireHttpsMetadata = false; options.ClientId = "customer.api"; options.ClientSecret = "testsecret"; options.ResponseType = "code id_token"; options.Scope.Add("customerprivatelinesvn.api"); options.Scope.Add("offline_access"); options.GetClaimsFromUserInfoEndpoint = true; options.SaveTokens = true; }); services.AddMvc(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app,IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default",template: "{controller=Home}/{action=Index}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback",defaults: new { controller = "Home",action = "Index" }); }); } } 这是Identity Server上的登录页面 但是有一个无限循环调用http://localhost:9000/connect/authorize端点,然后它返回到http://localhost:60002/signin-oidc,“Bad Request – Request Too Long”如下所示. 当我查看cookie时,有很多项目“.AspNetCore.Correlation.OpenIdConnect.xxx” 这是在Identiy Server上的日志.它说Identiy.Application已成功通过身份验证. 有谁知道这个问题是什么?以及如何解决这个问题?非常感谢你. 最好的祝福, 凯文 解决方法
好吧,您的Identity Server日志中显示了很长的请求 – 错误显示“错误请求 – 请求时间过长”.我猜这个问题是你的请求太大了:)
maximum length of HTTP GET request? 你试过发帖而不是使用GET吗? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – 使用ASP.NET MVC响应HTTP HEAD请求
- asp.net-mvc – 为什么log4net不记录nhibernate信息
- asp.net – 如果禁用ViewState会发生什么
- asp.net-mvc – 文件“?/ Views/Position/Edit.cshtml”不能
- asp.net-mvc-3 – 如何修改MVC3视图页面中的body类
- asp-classic – 使用经典ASP区分测试和生产的最佳方式
- asp.net – Visual Studio 2015 RC中的界面上的错误“Visua
- asp.net – 在ASP中使用其他项目的用户控件
- ASP.NET C#Active Directory – 查看用户密码到期之前的时间
- asp.net – 单元测试和Log4net
- asp.net – <%#Eval(“State”)%>或<%#DataBi
- asp.net-web-api – 认证/授权MVC 5和Web API –
- asp.net-mvc – ASP.NET MVC V2 – 好友类
- 当调用ASP.NET System.Web.HttpResponse.End()时
- asp.net-mvc – 重启后浏览器不缓存资源
- asp.net-mvc – ASP.NET MVC从c#代码创建绝对url
- asp.net – 使用Using语句的SQLConnection,从里面
- 扩展(ASP.NET)BoundField
- 在asp.net生成的代码中没有“使用”引用
- asp.net – 如何提取与Outlook正在显示的employe