JWT Error between app.UseRouting() and app.UseEndpoints(...).

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();

//.net core3以上UseAuthentication要在UseRouting上下,以及Endpoint之间,.net core2不用

///添加jwt验证
app.UseAuthentication();
app.UseRouting();
///添加jwt验证
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}

 

 
 

posted on 2021-06-10 23:35  卡农2014  阅读(134)  评论(0编辑  收藏  举报

导航