ASP.NET Core3.1使用Identity Server4建立Authorization Server-2
前言 建立Web Api项目 在同一个解决方案下建立一个Web Api项目 IdentityServer4.WebApi ,然后修改Web Api的launchSettings.json。参考第一节,当然可以不修改的,端口号为 5001 。 { "profiles": { "IdentityServer4.WebApi": { "commandName": "Project", "launchBrowser": true, "launchUrl": "weatherforecast", "applicationUrl": "http://localhost:5001", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } 添加Swagger帮助页面 官方文档: https://docs.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio&view=aspnetcore-3.1 在 Startup.ConfigureServices 方法中将Swagger生成器添加到服务集合: public void ConfigureServices