DNNCommunity / DNN.ActiveDirectory

Active Directory authentication for DNN
MIT License
26 stars 22 forks source link

User logged out on one device if loggin in to other device #79

Closed inu-web closed 3 years ago

inu-web commented 3 years ago

Describe the bug

If a AD User is logged in via AD on one device - lets say his Laptop via e.g. Chrome browser on the DNN Instance and the same user is connecting to the same DNN instance via an other device e.g. Tablet or Workstation (or even just another browser on the same device) - The User is logged off on the first device ...

Software Versions

To Reproduce

Steps to reproduce the behavior:

  1. Go to the webpage via webbrowser (e.g. Chrome) - User is logged in via AD on this device - OK ->Username is shown - User is logegd in
  2. Open an other browser (e.g. edge chromium or firefox) - User is logged in via AD on this device - OK -> Username is shown - User is logged in
  3. Open first browser (Chrome in this example) - NOK -> User is no more logged in in this browser / on this device - LoginLink is shown instead of username

Expected behavior

The user should be still logged in in the other browser / on the other device - even if he/she logs in on an other device too...

inu-web commented 3 years ago

Can anybody please help me with this issue? Any hint, leading me in the right direction is heighly appreciated thanks and regards Gerald

sawest commented 3 years ago

I was unable to reproduce this behavior. My steps: Open portal in Chrome, login with UserA. Open portal in Firefox, login with UserA. Went back to Chrome and was able to browse pages. User was still logged in. Went back to Firefox and was able to browse pages. User was still logged in.

This module handles authentication only. Once authenticated your browser receives a cookie to keep you logged in. There is no code in this module that voids a cookie that I am aware of. If something is voiding your cookie, I don't believe its coming from this module.

If someone can reproduce please let me know and share your steps.

inu-web commented 3 years ago

Hi Steven, thank you very much for your reply, thats strange ... so if i understand this correctly it must have something to do with the session cookie? If I inspect the set cookies when this happens (and I can reproduce it eache time I do this) the following situation seems to be the problem (also see attached screenshots): on the second browser (edge) the authentication cookie has the information "ActiveDirectory" on the browser where i was logged out (by AD/DNN/???) this cookie has no "ActiveDirectory" info in it How can this disappear - Only the website / DNN could have changed this cookie - isn´t it?

thanks Gerald

20210409_ADproblem_LoggedOut 20210409_ADproblem_LoggedIn

sawest commented 3 years ago

The .DOTNETNUKE cookie is the one you need to pay attention to. If that cookie is removed then you are logged out.

There are a number of ways a cookie can be removed. Yes the website could void or expire the cookie. The browser could also remove this cookie.

inu-web commented 3 years ago

Same situation with the .DOTNETNUKE cookie ... its there but has no content when "logged out" (same like when I log out from DNN manually) The Content of the .DOTNETNUKE cookie is empty in the "first" browser and content is "...87AA86DC79336653B08B7CC..." on the "second" browser

Any idea who/what could clear this cookie - should only be the case on session timeout and manual logoff !?

I do not know much about AD, but I think AD or windows cannot do this!?

Could it be any setting in DNN or in IIS/webconfig that allows only one session for a user if configured?

thanks again your help is highly appreciated regards Gerald

valadas commented 3 years ago

I am not 100% sure about this, but could it be part of DNN security enhancements, if so, the behavior might vary per DNN version maybe...

sawest commented 3 years ago

I am not sure why that cookie would be cleared but that is the problem. This module doesn't create nor remove/clear cookies. DNN's core does that. This module authenticates then hands it over to DNN to do the login.

inu-web commented 3 years ago

thanks for not leaving me alone in the dark ;-) any idea how to check if its a dnn 9.6 thing? I have no other installation with AD to check this with other DNNVersions (especially lower Versions) The AD installation is on a live environment (on premise in the clients network) and if possible I do not want to upgrade dnn at this moment just by chance ... Is there anything else I could check to get closer to the problem? regards Gerald

sawest commented 3 years ago

I am afraid the issue you are experiencing is outside the scope of this module which means the advice you will get here will be limited. I know much more about this module then about DNN core. You could possibly find better help and advice at the DNN Platform GitHub: https://github.com/dnnsoftware/Dnn.Platform and/or possibly the DNN community forums: https://www.dnnsoftware.com/forums.

valadas commented 3 years ago

Since this relates to security, I would ask the question by emailing security@dnnsoftware.com to at least ask if it's an expected behavior because of security or it's a bug...

inu-web commented 3 years ago

Thank you very much for taking the time to advice, I am a few steps further now, knowing its not the AD-Module and where to look next have a nice weekend

inu-web commented 3 years ago

Hi again ... as you can see in the history above, I posted this issue in dnn platform github issues as advised. https://github.com/dnnsoftware/Dnn.Platform/issues/4625 the advise I got there was to check if the same is happening without AD Module activated ... The result is: The user keeps logged in in both browsers if AD-Module is not set to "Enabled" in its configuration

Mitchel Sellers also noted that maybe some change in the users profile or configuration may clear the .DOTNETNUKE cookie ... could be a place to look for in AD module - right?

To get more information we checked "Enable Debug Mode" and

I dont know if this has anything to do with AD Module but I add the log entries below - there was nothing more in the file than this after reproducing the problem Thanks in advance for your help

_2021-04-27 09:13:20.385+02:00 [SERVERNAME][D:4][T:86][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.Http.WebHost.HttpControllerHandler.d31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 2021-04-27 09:13:20.385+02:00 [SERVERNAME][D:4][T:135][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.Http.WebHost.HttpControllerHandler.d31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 2021-04-27 09:13:20.387+02:00 [SERVERNAME][D:4][T:143][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.Http.WebHost.HttpControllerHandler.d31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 2021-04-27 09:13:20.388+02:00 [SERVERNAME][D:4][T:144][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.Http.WebHost.HttpControllerHandler.d31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 2021-04-27 09:13:20.387+02:00 [SERVERNAME][D:4][T:31][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.Http.WebHost.HttpControllerHandler.d31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.WebHost.HttpControllerHandler.d_0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

inu-web commented 3 years ago

While looking through the code I found in the AuthenticationController.vb -> Sub AuthenticationLogon() there is a Sub "UpdateDNNUser" called that updates various UserInfo / Profile fields ?

    Private Sub UpdateDNNUser(ByVal objReturnUser As UserInfo, ByVal objAuthUser As ADUserInfo)
        With objReturnUser
            If Not (objAuthUser.DisplayName = "") Then
                .DisplayName = objAuthUser.DisplayName
            End If
            If Not (objAuthUser.Email = "") Then
                .Email = objAuthUser.Email
            End If
            ...
            ...
        Dim objAuthUserController As New UserController
        objAuthUserController.UpdateDnnUser(objReturnUser)
    End Sub

Maybe some code like that could force the .DOTNETNUKE cookie to be deleted because the user info was changed (like Mitch Sellers noted ?)

regards Don & Gerald from in-u!

sawest commented 3 years ago

I can confirm three things. First, that the user profile gets updated each login to keep it sync'd with AD. Second, the DNN user's password is randomized and reset each login on the DNN instance. Lastly, this is the same behavior this module has used since the beginning, or at least as long as I have been on the project, and I am unable to duplicate the issue.

If resetting the user's password or updating the profile causes a logout, I am not sure why I don't experience a logout in my testing. I have tested against DNN 9.8 so I don't think its something new that's been added.

I will keep looking for you and help any way I can.

inu-web commented 3 years ago

Thank you for your tests and efforts ... mitchelsellers promises its not the dnn core and you say its not the AD Module ... Dont let me be stuck in the middle of dnn and the AD-Module ;-) https://github.com/dnnsoftware/Dnn.Platform/issues/4625#issuecomment-827691467

Okay: What could I do to help tracking that issue down if you can not reproduce this? any settings for deeper logging I can make to provide more useful informations about what is going on?

Could it be any<thing other we have overseen - some DNN- or AD-Modukle setting or webconfig entry to check? Thanks again for your help and best regards

mitchelsellers commented 3 years ago

Second, the DNN user's password is randomized and reset each login on the DNN instance

This is the root cause. If a users' password changes in DNN it WILL log the user off in all other locations. If the AD Provider is changing the password at every login, this is why the issue occurs.

The recommendation would be to not change the password.

sawest commented 3 years ago

I can't seem to figure out why this doesn't and hasn't happened in any of my environments.

I am not sure why, but the password is randomized when the DNN user is created. Its not set to the AD password. This could be for password complexity issues between the 2 systems, or the security of not storing AD passwords in the DNN instance. Since there is no way to know the DNN user's password during authentication, the password is randomized and reset each time (after authenticated to AD) in order to call the validateuser method in the UserController.

I have always thought this is a lot of overhead but haven't seen a good way around it. Does anyone know of a way to validate against DNN without knowing the password?

mitchelsellers commented 3 years ago

Typically you wouldn't validate against DNN, you would simply get the user information and login since you did your own validation of identity.

sawest commented 3 years ago

I am not an expert on the login process by any means so all the help is much appreciated. Doesn't the module need to call a DNN method from MembershipProvider in order to login? The module does validate identity with AD, and gets user information, but the actual login is still a call to the DNN core. The login process happens when UserController.ValidateUser is called from the AD module. This module isn't using that method for validation, as much as for the login piece. Looking at the platform code, that aforementioned method calls the MembershipProvider.Instance().UserLogin method. This method creates the cookies, etc for login.

Unless there is another way to execute a login, this ValidateUser method (and underlying UserLogin method) requires a password. Is there another way to execute a login using DNN's membership provider? Can anyone point out some documentation on authentication providers that I can check this module against?

Thanks for the help @mitchelsellers

mitchelsellers commented 3 years ago

You don't have to call ValidateUser at all to login the user. Within the context of an Auth_System you can just raise the authenticated event and DNN will do all of the login for you.

For example (In C#)

var eventArgs = new UserAuthenticatedEventArgs(user, username, status, "PROVIDER") { Authenticated = isAuthenticated, Message = message };

        OnUserAuthenticated(eventArgs);

user = a DNN UserInfo object. Could be obtained using UserController.GetUserByName() or otherwise username = The actual username of the user status = The login status, set it to success and the user will be logged in "PROVIDER" = This is the name of the provider as defined in the manifest message = Is any additional message you want.

sawest commented 3 years ago

Great info. I begin refactory as soon as I can to obsolete the validateuser portion of the module. If all goes well, the update will roll out with dependency injection also. Thanks

mitchelsellers commented 3 years ago

Feel free to email me or otherwise with questions as well.....I've built lots of authentication providers!

sawest commented 3 years ago

I was able to get to this quicker than I thought. I pushed a beta release of 8.0.0. It tested good in my environment. @inu-web try this version when you can and let us know if your log out issue is resolved.

inu-web commented 3 years ago

Hi again - First thanks again for the quick response - but things got (much) worse for us with this version

After installing the 8.0.0. Version DNN was no more loading the home page, showing following error:

Server Error in '/' Application. Could not load file or assembly 'DotNetNuke.Authentication.ActiveDirectory' or one of its dependencies. An attempt was made to load a program with an incorrect format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'DotNetNuke.Authentication.ActiveDirectory' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'DotNetNuke.Authentication.ActiveDirectory' could not be loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[BadImageFormatException: Could not load file or assembly 'DotNetNuke.Authentication.ActiveDirectory' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +95 System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64 System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +59 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +49

[ConfigurationErrorsException: Could not load file or assembly 'DotNetNuke.Authentication.ActiveDirectory' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +550 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +30 System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +173 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1069 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +130 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

[HttpException (0x80004005): Could not load file or assembly 'DotNetNuke.Authentication.ActiveDirectory' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3770.0

We had to manually remove everything of AD-Module to get dnn up and running again. Then we tried to unsinstall AD Module completely and reinstall 7.0.0. ... but since then we are still not able to login via AD (what worked before that update) ... just getting redirected to

/DesktopModules/AuthenticationServices/ActiveDirectory/WindowsSignin.aspx?portalid=0

with following error message

Server Error

401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied.

Update: We were able to get it up and running again by copying the files of version 7.0.0 in Desktop Modules and bin again from another DNN Install ...

sawest commented 3 years ago

Can you confirm which version of DNN you installed 8.0.0 on to?

inu-web commented 3 years ago

DNN 09.06.01 is the version we have on both: clients production and on our dev server

sawest commented 3 years ago

That version should be new enough. Can you look in your DNN website folder, inside the bin folder and confirm these DLLs exist?

DotNetNuke.Abstractions DotNetNuke.DependencyInjection Microsoft.Extensions.DependencyInjection Microsoft.Extensions.DependencyInjection.Abstractions netstandard

inu-web commented 3 years ago

DotNetNuke.Abstractions DotNetNuke.DependencyInjection Microsoft.Extensions.DependencyInjection Microsoft.Extensions.DependencyInjection.Abstractions are there but no "netstandard.dll" in the bin folder I looked into a feew other newer DNN installations (9.7.2 and 9.8.1) ... none of them have a netstandard.dll in their bin folder either ... regards Gerald

sawest commented 3 years ago

The only reason I can find that you would get the error you shared is processor architecture. I changed the processor architecture to x86 when I began dependency injection. I have switched it back to Any CPU. I have compiled a release 8.0.3. I would strongly recommend a backup of the site and DB before installing. If you get a crash again, just do a restore of both. Should make recovery much easier and quicker.

Install this version when you can and post your results. Thanks for all the help.

inu-web commented 3 years ago

Hi Steven, No - I have to thank YOU for standing by me ... here are the results of the install: I installed v.8.0.3. on my dev machine first (trying to be a little bit smarter than last time when i installed 8.0.0 on the production system :-)

The DNN install again messed up after the installation.

Server Error in '/dev' Application.


DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +9949138 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +162 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1120 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +84 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +181 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +228 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +314

[HttpException (0x80004005): DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10086640 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4250.0

after copying back the files of the Version 7.0.0 - everything fine again

... anything else I can do to help you finding out what goes wrong?

regards Gerald

sawest commented 3 years ago

Great! Its a different error...baby steps.

Version 7 should no longer be there. Version 8 should have upgraded it. Seeing as you have 2 versions of the same module installed, I am betting that is why you are getting this error. Version 8.0.3 does not implement iHTTPModule but version 7 does so maybe your system is trying to load both versions at once?

This dual version problem was probably due to hacks you had to do to get 8 off earlier. I would suggest getting both versions cleaned off then reinstalling 8.0.3. This will give us a clean starting point and should fix the error above.

inu-web commented 3 years ago

Sorry, but no success ...

StartJob Starting Installation Info Starting Installation - DNN_ActiveDirectoryAuthentication Info Starting Installation - AuthenticationSystem Info Authentication registered successfully - ActiveDirectory Info Component installed successfully - AuthenticationSystem Info Starting Installation - Assembly Info Assembly registered - bin\Providers\DotNetNuke.Authentication.ActiveDirectory.dll Info Created - bin\Providers\DotNetNuke.Authentication.ActiveDirectory.dll Info Assembly registered - bin\Mvolo.FormsAuthenticationModule.dll Info Created - bin\Mvolo.FormsAuthenticationModule.dll Info Component installed successfully - Assembly Info Starting Installation - ResourceFile Info Expanding Resource file Info Created - install.css Info Created - license.txt Info Created - Login.ascx Info Created - logo.gif Info Created - ReleaseNotes.txt Info Created - Settings.ascx Info Created - TestCases.txt Info Created - trusterror.htm Info Created - UpgradeLog.htm Info Created - version.txt Info Created - WindowsSignin.aspx Info Created - App_LocalResources/Login.ascx.resx Info Created - App_LocalResources/Settings.ascx.resx Info Created - Documentation/Documentation.css Info Created - Documentation/Documentation.html Info Created - packages/ActiveDirectory_07.00.00_Install/license.txt Info Created - packages/ActiveDirectory_07.00.00_Install/ReleaseNotes.txt Info Resource Files created Info Component installed successfully - ResourceFile Info Starting Installation - Cleanup Info Component installed successfully - Cleanup Info Starting Installation - Config Info Creating backup of previous version - web.config Info Config file updated - web.config Info Component installed successfully - Config Info Config file changes committed - web.config Info Installation committed Info Installation successful. - DNN_ActiveDirectoryAuthentication Info Deleted temporary install folder EndJob Installation successful.

Server Error in '/pos' Application. DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +9949138 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +162 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1120 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +84 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +181 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +228 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +314

[HttpException (0x80004005): DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10086640 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4250.0

inu-web commented 3 years ago

Anything else I have to delete or do I have to change something in web-config before re-installing?

sawest commented 3 years ago

Thanks for the help. I will keep working on it. I couldn't find anything in web config that would cause this.

inu-web commented 3 years ago

To be sure this is not a DNN 9.6.1 issue or an issue with my current configuration I now made a totally fresh and clean install of dnn 9.9.1 and installed the AD Provider version 8.0.3. there ...

... also crashing (see below)

I hope this helps - If I can do anything else to help you finding the root of the problem - please let me know Gerald

Server Error in '/webdev991' Application. DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ConfigurationErrorsException: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +9949138 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +162 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1120 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +84 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +181 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +228 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +314

[HttpException (0x80004005): DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory implementiert kein IHttpModule.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10086640 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4250.0

inu-web commented 3 years ago

Hi Steven, may I ask if there is any progress regarding the installation troubles with v.8.0.3 ? thanks in advance and kind regards Gerald

sawest commented 3 years ago

Not yet. My real job is keeping me pretty busy at the moment.

inu-web commented 3 years ago

I truly understand Steven, but this is a real showstopper for me at one of my clients installations. I would really like to help in solving this issue. If there is anything I could do to help, please let me know. Would it be helpful if I install a source version and try to compile it by myself in VisualStudio on my dev machine with the DNN 9.9.1 version? Or is this ofno use to narrow down the root of the problem?

sawest commented 3 years ago

I don't think that would help. It compiles without any issues for me. Hopefully I will get some time to look more at it very soon.

inu-web commented 3 years ago

Thank you very much, your efforts are highly appreciated...

sawest commented 3 years ago

I have worked on this over the weekend. The dependency injection is causing all the issues. I am going to branch 7.0 and add the code to fix resetting passwords. I will leave out the injection and work toward that later in version 8. I hope to have a release with your fix in the next few days.

inu-web commented 3 years ago

Great! Thank you for taking the time in your leisure time to support us!

sawest commented 3 years ago

@inu-web I have pushed a new release (7.2.0). I have installed it and tested multiple browser windows for this symptom. I do not see this issue in this release. Please install at your earliest convenience and report if your problem is resolved.

inu-web commented 3 years ago

@sawest - It installed without problems on my dev-machine and also on the Production system I am now able to login from two browsers on the same machine - So It seems to fix the major problem we faced. Thanks a lot!

Just waiting for feedback from my client, who will also test across different devices in the Active Directory Domain (Windows PC and iPad logged in via AD at the same time)

I post the results back here as soon as I get Feedback - and then I think we can close this issue!?

Thank you for all your help until now! regards Gerald

jncraig commented 3 years ago

Something is wrong. Reaching out for help. The "delete" function is not working

On Mon, May 10, 2021 at 12:56 PM in-u! websolutions < @.***> wrote:

@sawest https://github.com/sawest - It installed without problems on my dev-machine and also on the Production system I am now able to login from two browsers on the same machine - So It seems to fix the major problem we faced. Thanks a lot!

Just waiting for feedback from my client, who will also test across different devices in the Active Directory Domain (Windows PC and iPad logged in via AD at the same time)

I post the results back here as soon as I get Feedback - and then I think we can close this issue!?

Thank you for all your help until now! regards Gerald

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DNNCommunity/DNN.ActiveDirectory/issues/79#issuecomment-836963981, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDMRL4BH744W5MVPUQXPTTNAF4VANCNFSM42I2CDUQ .

sawest commented 3 years ago

What delete function? Can you provide more information? Errors? Steps to reproduce?

jncraig commented 3 years ago

Whoops. Not intended to go here.

On Mon, May 10, 2021 at 2:14 PM Steven A West @.***> wrote:

What delete function? Can you provide more information? Errors? Steps to reproduce?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DNNCommunity/DNN.ActiveDirectory/issues/79#issuecomment-837079016, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDMRK3GAZOJSETBRRKONTTNAPAVANCNFSM42I2CDUQ .

sawest commented 3 years ago

That's a relief. Lol

jncraig commented 3 years ago

For both of us!

On Mon, May 10, 2021 at 2:20 PM Steven A West @.***> wrote:

That's a relief. Lol

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DNNCommunity/DNN.ActiveDirectory/issues/79#issuecomment-837089482, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDMRNM7WGF35AHDIEML5LTNAPYFANCNFSM42I2CDUQ .

inu-web commented 3 years ago

Her comes the feedback from my client .. Great, the concurrent login problem seems to be solved - we now can stay logged in on different Computers and on different browsers on the same computer (Tested on Windows 10 PCs and one Windows Server)
Thanks a lot for all the efforts and solving this issue to @sawest !

But we still have another issue (which was already there before) and I am not sure if this may also have AD Auth as the root: The client ist always getting "too many redirects" Error if he calls the dnn-page from android or ios devices from within the network with the active directory ... have you ever tried to log in via AD from mobile Devices (Android and iOS) or do you have the possibility to test/try this?

We already tried all different settings for redirection on the portal Alias settings of the website but without any luck Any suggestion what we can do to find out what is going on here?

Thanks and kind regards Gerald