Not having seen this working in 4.3.5, I implemented a fix myself. I am using ADSI authentication - I have not mapped out the path for forms based authentication. Code change in 2 locations:
Record the incoming URL:
HttpModule.Authentication
AuthenticationModule.vb
OnAuthenticateRequest
Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs)
Dim _portalSettings As PortalSettings = Common.GetPortalSettings
Dim config As Authentication.Configuration = Authentication.Configuration.GetConfig()
If config.WindowsAuthentication Then
Dim Request As HttpRequest = HttpContext.Current.Request
Dim Response As HttpResponse = HttpContext.Current.Response
Dim authStatus As AuthenticationStatus = AuthenticationController.GetStatus(_portalSettings.PortalId)
Dim blnWinLogon As Boolean = (Request.RawUrl.ToLower.IndexOf((AUTHENTICATION_LOGON_PAGE).ToLower) > -1)
Dim blnWinLogoff As Boolean = (authStatus = AuthenticationStatus.WinLogon) AndAlso (Request.RawUrl.ToLower.IndexOf((AUTHENTICATION_LOGOFF_PAGE).ToLower) > -1)
If (authStatus = AuthenticationStatus.Undefined) Then 'OrElse (blnWinLogon) Then
AuthenticationController.SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinProcess)
Dim url As String
If Request.ApplicationPath = "/" Then
url = "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
Else
url = Request.ApplicationPath & "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
End If
Try
Dim refUrl As String = Request.RawUrl
Response.Clear()
Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Value = refUrl
Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Path = "/"
Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Expires = DateTime.Now.AddMinutes(2)
Catch
End Try
Response.Redirect(url)
ElseIf (Not authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogoff Then
Dim objAuthentication As New AuthenticationController
objAuthentication.AuthenticationLogoff()
ElseIf (authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogon Then ' has been logoff before
AuthenticationController.SetStatus(_portalSettings.PortalId, AuthenticationStatus.Undefined)
Response.Redirect(Request.RawUrl)
End If
End If
End Sub
Redirect to captured URL:
DotNetNuke.Library
Components
Authentication
AuthenticationController.vb
AuthenticationLogon
Public Sub AuthenticationLogon()
Dim _config As Authentication.Configuration = Authentication.Configuration.GetConfig()
.......
.......
' does nothing, just to force page to be refreshed
Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString()
Dim strURL As String = NavigateURL(_portalSettings.ActiveTab.TabID, "", querystringparams)
If Not HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()) Is Nothing Then
querystringparams = HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()).Value
If querystringparams <> "" Then strURL = querystringparams
End If
HttpContext.Current.Response.Redirect(strURL, True)
End Sub