Kentico SecurityEvents.Authenticate.Execute is not getting called

Sofia Khatoon asked on February 17, 2016 23:27

I have App_Code folder with CMSModuleLoader for authentication in my Kentico CMS 8.0.21 I also have an HTTP module to handle Formsauthentication cookie. The CMSModule Loader event never gets called. What is the best way to get a call to CMSModuleLoader events.

[CustomNewRelicSubstitutionLoader]

[CustomSecurityEventsAttribute]

[CustomErrorEventsAttribute]

[CustomRequestEventsAttribute]

[CustomSessionEventsAttribute]

public partial class CMSModuleLoader

{

private class CustomSecurityEventsAttribute : CMSLoaderAttribute

{

   public override void Init()

    {

        SecurityEvents.Authenticate.Execute += new EventHandler<AuthenticationEventArgs>

        (Authenticate_Execute);

    }

    /// <summary>

    /// called on every kentico authenticate attempt

    /// </summary>

    /// <param name="sender"></param>

    /// <param name="e"></param>

    private void Authenticate_Execute(object sender, AuthenticationEventArgs args)

    {

        if (args.User != null) //the authenticate was successful

        {

            try

Recent Answers


Roman Hutnyk answered on February 18, 2016 14:33

I'm not this is what causes your issue, but I've never seen that many attributes applied to public partial class CMSModuleLoader. Do others work? Have you tried to put only CustomSecurityEventsAttribute into a file single file?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.