Version 7.x > API > Post authentication event View modes: 
User avatar
Certified Developer 8
Certified Developer 8
spencer.h-mmtdigital.co - 1/30/2014 5:58:23 AM
Post authentication event

I need to register a session level object using dependecy injection when users successfully login to the CMSDesk.

I can hook into the SecurityEvents.Authenticate.Execute event but this happens as authentication is performed and not AFTER successful authentication. I could potentially have session objects created for no reason here when auth fails.

So ideally I only want to perform my DI resolve on successful auth!

I could use Application_BeginRequest event and check for IsAuthenticated in the HttpContext user object to perform the DI but seems a little heavy.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 2/13/2014 12:04:55 AM
RE:Post authentication event
Hello Spencer,

You are right, the Authenticate event is fired every time the user is trying to authenticate but in this event you can simply check if the user was authenticated successfully with simple condition using the Kentico API. I would recommend you to take a look at the API Reference and search for the method: IsAuthenticated().

Best Regards,
Martin Danko