I have a custom HTTP Module running on IIS 7.5, and the requests will be coming from different machines in the same Active Directory environment. Is it possible for me to get the current user (their AD Name?) from a request (or look up, if I knew the LDAP path?) in an HTTP Module running server side?
I'm not AD expert, but I've looked through the different properties that come through the HTTPApplication
instance (see below) within my module, and I'm not seeing anything obvious.
Private Sub AuthenticateRequest(sender As Object, e As EventArgs)
Dim oHttpApplication As HttpApplication = CType(sender, HttpApplication)
'...
' Get AD Info from oHttpApplication.Request?
'...
End Sub
Does anyone know if this is possible or know of a way to accomplish this?
UPDATE:
I've added my solution below.