1 回答
TA貢獻1878條經驗 獲得超4個贊
好的,我在這篇博文.NET Core 3.0 Preview 4 中的 ASP.NET Core 更新中找到了答案
我必須更改我的身份驗證注冊順序
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseAuthentication();
app.UseRouting();
app.UseEndpoints(routes =>
{
routes.MapControllers();
});
}
到
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(routes =>
{
routes.MapControllers();
});
}
所以這解決了我的問題。
- 1 回答
- 0 關注
- 97 瀏覽
添加回答
舉報
