I am working on an ASP.NET MVC Core application. I have policy based authentication in my Project. Added [Authorize] attribute on all my controllers. My requirement is that whenever there is an Unauthrorized Access, i have to do some work. Because of this i have to override HandleUnauthorizedRequest. But i am unable to find any way to get access to this method.
My requirement is that, all other [Authorize] attribute functionality should work as it is but whenever there is Unauthorized access i have to write it to log file and dump this in DB.
I am stuck, any help would be much appreciated