• Login
  • Register

DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Problem modifying logout

You are not authorized to post a reply.

New Around Here

    Creating an auth provider and I've had some success with login 
    But now that I'm working on logoff I can't even seem to hit the breakpoint in the authentication provider I put together.

    I see logoffHandler in web.config

    <add name="LogoffHandler*" path="Logoff.aspx" verb="*" type="DotNetNuke.Services.Authentication.LogOffHandler, DotNetNuke" preCondition="integratedMode"/>

    Not sure if it's related. Maybe I need to update the package to explicitly set my logoff as the logoff for the module?      

    New Around Here

      install settings do have logoff control source set properly but that control is still not being hit on any breakpoint

      New Around Here

        Ok so searching the source I see a script that set ModuleControls to point logoff to:


        But having a setting in my .dnn file for the Authentication Module 

        Doesn't update that setting in ModuleControls 

        I went into the DB to manually update it, I guess I need to create a sql script to do the update in the package, was hoping it would be set by the auth package definition.

        If I did something wrong let me know

        New Around Here

          OK so I'm back at this issue

          Creating a modified authentication process realized I needed to tell UserAuthenticatedEventArgs my Authentication Type

          var eventArgs = new UserAuthenticatedEventArgs(user, msIndividual.emailAddress, loginStatus, "myCustomAuth")

          But now when I try to logout it fails. I'm sure I'm missing something probably simple but the error I get back is 

          System.InvalidCastException: Unable to cast object of type 'ASP.desktopmodules_myCustomAuth_logoff_ascx' to type 'DotNetNuke.Services.Authentication.AuthenticationLogoffBase'.

          New Around Here

            You know how you post a question to a forum after you are certain you are stumped, and then immediately after figure out the issue.

            My auth template had

            public partial class Logoff : UserModuleBase

            I updated it to

            public partial class Logoff : AuthenticationLogoffBase

            And that got me to be able to start modifying code and seeing breakpoints hit

            Veteran Member

              Oh, wow... You've had quite the journey through this challenge.  Sorry, I'm just now seeing this, but I was reading through this thinking you might be missing a class, and there it is.  Thank you so much for also posting the solution!  :) 

              In the future, we have a working template that we usually use for authentication providers, and is about to be released in the next major release of the Upendo DNN Generator.  This will make it easier for you and others to get started in the future. Sorry it's of less help to you right now, though. :( 

              You are not authorized to post a reply.

              These Forums are dedicated to the discussion of DNN Platform.

              For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

              1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
              2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
              3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
              4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
              5. No Flaming or Trolling.
              6. No Profanity, Racism, or Prejudice.
              7. Site Moderators have the final word on approving / removing a thread or post or comment.
              8. English language posting only, please.

              Would you like to help us?

              Awesome! Simply post in the forums using the link below and we'll get you started.

              Get Involved