简体   繁体   English

用户通过身份验证后触发事件-Windows身份验证C#

[英]Fire event after user is authenticated - windows authentication c#

I have used windows authentication in my application. 我在应用程序中使用了Windows身份验证。 I want to add log for successful login but can not find any event which fired after login only once. 我想添加成功登录的日志,但是找不到仅登录一次后触发的任何事件。

I tried to add code in global.asax Application_AuthenticateRequest event but this event fires every time. 我试图在global.asax Application_AuthenticateRequest事件中添加代码,但是每次都会触发此事件。 Also tried to add logic in base controller but same thing happens. 还尝试在基本控制器中添加逻辑,但是会发生相同的情况。

So please help me to find the event where i can add logic for insert logs for success login into database, 因此,请帮助我找到可以添加逻辑以成功登录数据库的事件,

Best will be to add a log from the stored procedure that executes to authenticate. 最好的方法是从存储过程中添加一个执行身份验证的日志。 If it is successful, add log of success, either of failure. 如果成功,则添加成功日志或失败日志。 You won't need to look for events. 您无需寻找事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM