79563029

Date: 2025-04-08 20:50:41
Score: 0.5
Natty:
Report link

I know this is somewhat old question, but to solve this, I decided to use HttpContext.Items in my implementation of IAuthenticationService to put a value with key like AuthenticationException there, and then read that in other middleware or filter.

Note that It may look tempting to use HttpContext.Features.Get<IAuthenticateResultFeature>().AuthenticateResult, but this feature is not set for failed authentications! I've spent several hours debugging this, only to understand that I need to look for another way.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: onestep.ua