Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Preserve Login ParametersPreserve Login Parameters
Previous
 
Next
New Post
7/11/2006 1:27 PM
 

Preserve Login Parameters - when a user is directed to the login screen, the system needs to retain the original url ( with parameters ) so that it can redirect back after successful login ( especially useful in nested module UIs like Forum )

This does not appear to be working.  When I follow a link which leads to a details page of a module, I am redirected just to the page the module is on the first time the credetial cookie is set.  If I follow the link after that, I go where I expect to go.

Authentication: Network
DNN Version:  4.3.1 Release Candidate (upgrade from 3.2.2)

 
New Post
9/28/2006 8:20 PM
 

I can't find any information about this feature anywhere, there are 3 posts about this already, wiith no real answers yet.

Does it work?

Where is it?

How can I turn it off and on.

 
New Post
9/29/2006 11:30 AM
 

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

 
New Post
1/3/2007 4:35 PM
 

Updated for 4.4.0

Record the incoming URL:

HttpModule.Authentication
AuthenticationModule.vb

Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs)
.....
If (AuthenticationController.GetStatus(_portalSettings.PortalId) = 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 ....
......
End Sub

Redirect to captured URL:

DotNetNuke.Library
Components
Authentication
AuthenticationController.vb

 Public Sub AuthenticationLogon()
.....

.....

' params "logon=windows" does nothing, just to force page to be refreshed
'Dim strURL As String = NavigateURL(_portalSettings.ActiveTab.TabID, "", "logon=windows")
'HttpContext.Current.Response.Redirect(strURL, True)
'Updated to redirect to querrystring passed in prior to authentication
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 <> "" And querystringparams.IndexOf("WindowsSignin.aspx") < 0 Then strURL = querystringparams
End If
HttpContext.Current.Response.Redirect(strURL, True)
End Sub
 
New Post
4/30/2007 10:37 AM
 

Hi

Will this code work with DNN 3.3.7?

Cheers

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Preserve Login ParametersPreserve Login Parameters


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

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

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. 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.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out