在我的AuthenticationHandler中,我有一些(共享的)代码,例如:
try
{
doSomething()
}
catch(AuthException e)
{
return AuthenticateResult.Fail(e);
}
我希望能够在其他中间件中访问该异常。像这样:
public async Task Invoke(HttpContext context)
{
context. ??? AuthenticationContext.Exception?
}