1
votes

I am having an issue with DotNetNuke platform that I cannot understand for the life of me... Google and SO searches have been no help.

The very first time any user tries to hit the site, regardless of the URL they are requesting, they are redirected to the URL below, and given the 404 error shown below. After that initial 404, if the user requests that exact same URL, everything works perfectly for that user going forward. They are redirected to the correct login page and everything works correctly from that point forward.

Does anyone know why this would only happen on the very first request to the site for each user? I have a Development, Test and Production environments set up, and the issue is consistent across all environments.

Requested URL: http://intranet.domain.com/page

Redirected URL: http://intranet.domain.com/Login.aspx?ReturnUrl=/DesktopModules/AuthenticationServices/ActiveDirectory/WindowsSignin.aspx

Server Error in '/' Application.

The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Login.aspx

  • IIS: v7
  • DNN: v7.02.01
  • Default DNN authentication is disabled and Active Directory Authentication module is enabled. (v5.0.6)

Please let me know if there is any other configuration information I can provide.

2
Maybe it works right the second time because of a cookie or session?alwaysVBNET
@alwaysVBNET Yeah that's what I was thinking too, but I'm not sure where to begin to troubleshoot it because that is all handled by DNN...Schmalzy
Why don't you instal the source code version and debugalwaysVBNET
Also is there anything logged under the event viewer?alwaysVBNET
Was a solution for this ever found?user2389345436357

2 Answers

0
votes

This is not a full solution however it should help shed some light on the situation. I experienced the same issue. I would go to the website and it would redirect me to

WebsiteLinkHere/DesktopModules/AuthenticationServices/ActiveDirectory/WindowsSignin.aspx

On removal of the

DesktopModules/AuthenticationServices/ActiveDirectory/WindowsSignin.aspx

it would take me to my homepage and everything acted as expected from there on out. I grabbed the latest sourcecode from github for this module and started debugging. I traced the error down to the DNNUserController.ValidateUser() function. This seems to be returning nothing which then causes the page to error out. I decided to add a bandaid fix for the time being which may help others.

Within the WindowsSignin.aspx.vb file I added a try catch around

objAuthentication.AuthenticationLogon()

Within the catch statement I added the code that is used to redirect you after a successful authentication to the page you came from.

Try
    objAuthentication.AuthenticationLogon()
Catch
    Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString()
    Dim strUrl As String = DotNetNuke.Common.NavigateURL(DotNetNuke.Entities.Portals.PortalSettings.Current.ActiveTab.TabID, String.Empty, querystringparams)
    If Not HttpContext.Current.Request.Cookies("DNNReturnTo") Is Nothing _
        Then
        querystringparams =
            HttpContext.Current.Request.Cookies("DNNReturnTo").Value
        'ACD-8445
        If querystringparams <> String.Empty Then querystringparams = querystringparams.ToLower
        If querystringparams <> String.Empty And querystringparams.IndexOf("windowssignin.aspx") < 0 Then _
            strUrl = querystringparams
    End If
    HttpContext.Current.Response.Redirect(strUrl, True)
End Try

This is not an elegant solution however it does escape the issue of the user's initial visit to the site being an error screen. Everything else seems to work as expected after the initial visit.

0
votes

I finally found the answer over two years later...

The problem was solved by commenting out "add name="Authentication" ..." line in web.config. This disabled autologin feature completely.

http://www.dnnsoftware.com/forums/threadid/459907/scope/posts/site-redirecting-to-desktopmodules-authenticationservices-activedirectory-windowssigninaspx