Active Directory Authentication

I have a C # class that uses the WindowsIdentity namespace to return information about the current Active Directory user. This is available through a web part in SPS and will certainly return the desired record values ​​specific to that user.

I have a classic ASP application that I would like to inherit with this functionality. After it was finished as COM and registered with the server, I created a classic ASP page from which I could call and display the details in a browser window.

My problem is that when accessing this page from an authenticated user on the client machine, only the user data is displayed which is displayed on the local machine.

How do I change my code so that I can display the details of the user accessing the page from the client machine?

+1


source to share


2 answers


Classic ASP brings us back. :-) Don't think I've touched it since 2002 ...

Is there something wrong just looking at Request.ServerVariables ("logon_user") in an ASP page? This should give you domain \ username.



Instead of trying to run the COM terminated class under the end user id (which is the problem you are facing), you can simply pass the domain \ username through the class to get the account details from AD and then display whatever you need elements. This saves you the trouble of impersonating the current user's Windows ID.

+1


source


Also check what authentication methods are performed on the site as in IIS.

Right click the website in IIS Manager, Properties -> Directory Security -> Authentication and Access Control -> Edit ...



Make sure Windows Standard Authentication is enabled and anonymous access is allowed.

+1


source







All Articles