【发布时间】:2022-02-06 04:49:38
【问题描述】:
我正在按照本教程设置 Ids4,我的步骤与视频相同,但是当我导航到 https://localhost:5443/.well-known/openid-configuration 时,我得到了 404。
我做过的事情:
- 创建了一个新的Web APP -添加了 IdentityServer4 nuget 包 - 编辑启动如下:
公共类启动 {
public void ConfigureServices(IServiceCollection services)
{
services.AddIdentityServer()
.AddInMemoryClients(new List<Client>())
.AddInMemoryIdentityResources(new List<IdentityResource>())
.AddInMemoryApiResources(new List<ApiResource>())
.AddInMemoryApiScopes(new List<ApiScope>())
.AddTestUsers(new List<TestUser>())
.AddDeveloperSigningCredential();
services.AddControllersWithViews();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseIdentityServer();
app.UseAuthentication();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
}
}
}
如果我导航到 localhost,它应该会显示一个 hello world,但发现文档会返回 404。关于原因有什么想法吗?
【问题讨论】:
标签: asp.net-web-api identityserver4