Enable Signin Event Logging #1179
-
I am working on a website that will have an audit log associated to it. Events will be stored in a SQL Server DB and I would like to include login events in my DB. Since the code is of course injected and I am not sure how I can insert my snippet to capture a log and INSERT into my Table. Below is essentially all the code I am looking to add:
...or at least something to this effect. I have this snippet in another controller logging administrative actions against resources in the website. Really all I need to know is a way to insert code such that when the login redirect would return back to the application it will create the log and save to the DB. Thanks in advance. :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I solved my own problem. For any potential usefulness to anyone else in the future I will add what I did below.. I set up my database according to this documentation: https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-5.0&tabs=visual-studio I created this Middleware Class
And injected into Startup.cs likeso:
|
Beta Was this translation helpful? Give feedback.
I solved my own problem. For any potential usefulness to anyone else in the future I will add what I did below..
I set up my database according to this documentation: https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-5.0&tabs=visual-studio
I created this Middleware Class