LockedWindows Authentication without AD membership provider

Author
APGvNext (Sam)
vNext Owner
  • Total Posts : 12456
  • Reward points : 218330
  • Joined:
  • Status: offline

Windows Authentication without AD membership provider

If you wish to use Windows Authentication without AD provider, the solution is to:
  1. Configured IIS to enable Windows Authentication and disable Anonymous Authentication;
  2. Configure the Forum Application (the forum folder that is marked as an application) to use the Classic .NET AppPool if you are on IIS 7.0 or later;
  3. Leave ASPPlayground.NET Forum Software configured with the default configuration i.e. Forms Authentication Enabled without enabling any Membership Provider Integration.
    1. Make sure you uncheck “No Action – Must Register First” option under ASPPlayground Admin Control Panel, User Features 1/2, Guest Permission
  4. Add members to ASPPlayground so that the membership table for the forum is populated (simply use the Fast Member Import feature in the AdminCP). The Login value must match the users Active Directory (AD) account name, but password can be anything (not used in this integration mode).
  5. Modify a small section of code in the Default.aspx.vb file as follows (use the following code to replace the existing Protected Sub Page_PreInit ):
           
    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
         Integer.TryParse(Request.QueryString("forumid"), RequestedForumID)

         If Not User.Identity.IsAuthenticated Then
             Dim strUsrNm As String

            'Build a string containing the AD account name of the Windows Authenticated user        
            strUsrNm = Request.ServerVariables("LOGON_USER")
            strUsrNm = Mid$(strUsrNm, InStr(1, strUsrNm, "\") + 1)
            'Create the authentication ticket and add it to the cookie collection        
            FormsAuthentication.SetAuthCookie(strUsrNm, True)
            'refresh the current page so the it displays “Welcome <username>”        
            Response.Redirect(Me.Request.Url.ToString)
        End If
    End Sub
     
  6. Do NOT mix this method with the AD Membership Provider integration described here. In other words, make sure you
    1. do NOT add any AD membership provider information into the forum's web.config, and
    2. do NOT set EnableMembershipIntegration appSettings key to true.
post edited by Samuel -

Attached Image(s)

#1
Jump to:
© 2013 APG vNext Commercial Version 4.3