As we studied in last article, Filters are used to inject logic at the different levels of request processing. Below is the filters execution sequence:
Authentication Filters ==> Authorization filter ==> Action filter ==> Result filter ==> Exceptionfilter
The program invokes Authentication Filters by calling this method. This method creates the AuthenticationContext. AuthenticationContext has information about performing authentication. We can use this information to make authentication decisions based on the current context.
OnAuthenticationChallenge Method
This method executes after the OnAuthentication method. We can use the OnAuthenticationChallenge method to perform additional tasks on request. This method creates an AuthenticationChallengeContext the same way as OnAuthentication.