控制台应用程序尝试获取发现信息
var disco = await DiscoveryClient.GetAsync("http://localhost:5000");
正常工作,但是我想弄清楚这个东西是如何工作的,我似乎无法捕获http流量。
如果我使用http://localhost.fiddler重定向到本地代理会出错: Error connecting to localhost.fiddler:5000/.well-known/openid-configuration: HTTPS required (it's not setup with HTTPS, the error msg is misleading!) 奇怪的是,在代码后面,当我们尝试通过web-api进行身份验证时,却发生了这种情况。
var response = await client.GetAsync("http://localhost.fiddler:5001/identity");
localhost.fiddler运行良好,现在它在同一个console.app中运行,在program.cs文件中。这让我疯狂,为什么无法捕获到发送到5000端口的流量?这是HTTP协议啊!那么是什么神秘的原因导致这种情况出现?是否还有其他方法来查看发送到Identity Server并返回的 HTTP 流量的魔力?
添加了 Startup 类
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// configure identity server with in-memory stores, keys, clients and scopes
services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(Config.GetApiResources())
.AddInMemoryClients(Config.GetClients())
.AddTestUsers(Config.GetUsers());
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseIdentityServer();
}
}
新增了博客,如果我们能解决这个问题,会更新并标注您的贡献。
http://localhost.fiddler:5000
怎么样? - Tarun Lalwani