C#
C#

help

Root Question Message

Bread
Bread9/29/2022
Possible to 'intercept' a successful sign in attempt with .net core identity?

I was curious if it was possible to add some middleware that would detect if someone has signed in successfully with Identity, I'd like to raise my own events and handle them as I need
FroH
FroH9/29/2022
You can custom Log in Action => you can raise any event you want
Bread
Bread9/29/2022
I won't have control over the controller
FroH
FroH9/29/2022
create your own login page and use SignInManager would be good enough
Sossenbinder
Sossenbinder9/29/2022
If you're referring to HttpContext.SigninAsync, then I think it ultimately at some point requests a IAuthenticationService through DI, which has the SignInAsync method
Sossenbinder
Sossenbinder9/29/2022
Maybe you can create a decorator for IAuthenticationService and register it
Sossenbinder
Sossenbinder9/29/2022
With the decorator raising an event
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy