2015-11-27 66 views
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 ??? 
}); 
    ..... 

回答

1

我刚刚使用使用而不是运行,它的工作原理。

相关问题