This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Description
By default, both the OIDC and the OAuth2 bearer middleware throw a bunch of security exceptions when a token is invalid. These exceptions are caught but the catch handler always re-throw them if you don't override the AuthenticationFailed notification and explicitly call HandleResponse() or SkipToNextMiddleware(), which is - obviously - a very bad thing, as you don't want to get a 500 response - or worse, an error page - for an invalid token.
In this case, 401 is the only response you want: https://tools.ietf.org/html/rfc6750#section-3.1