I'm adding ASP.Net Identity to an existing site and I need to be able to record in an audit trail when a user signs in and signs out.
Are there any events or methods that I can override that are triggered when a user successfully signs in or out but not for every time they request a page during a session? This also includes when a user session expires and they are automatically signed out.
The site has a requirement to support both local users and Windows Integrated Authentication (there are multiple deployments and it is selectable by the customer) so I either need something that works for both types of authentication or a separate ways for each.
The site uses Web Forms, asmx web services and WebAPI services so it needs to be compatible for all of these although initial login is always through a form on a web page.
Edit: I found this https://stackoverflow.com/a/24399919/1093406 showing the use of ICookieAuthenticationProvider.ValidateIdentity but this looks to be every time the user makes a request instead of just the initial logon; it also doesn't work for Windows Integrated Authentication.