0
我想在Asp.Net中使用BasicAuth。这工作到目前为止。只有一件事我不明白。鉴于以下代码,如果用户通过身份验证,如何继续传入请求?如何继续请求?
它看起来好像BasicMiddleware具有所需的下一个RequestDelegate。但是,如何在Run方法中访问它?
public void Configure(IApplicationBuilder app,
IHostingEnvironment env,
ILoggerFactory loggerFactory)
{...
app.Run(async (context) =>
{
if (!context.User.Identity.IsAuthenticated)
await context.Authentication.ChallengeAsync();
else
wait ???
});
.....