views:

98

answers:

0

I have a COM object written in Delphi, which uses Active Directory Services to return the current logged on user. This is the code I use :

var
  SysInfo : IADsWinNTSystemInfo;    
begin
  SysInfo := CoWinNTSystemInfo.Create;
  Result := SysInfo.DomainName + '/' + SysInfo.UserName;
end;

CoWinNTSystemInfo is just a wrapper around Activeds.dll and does the following :

CreateComObject(CLASS_WinNTSystemInfo) as IADsWinNTSystemInfo;

This works fine when the COM object is called from another windows executable, but we have someone trying to call it in ASP.NET. Apparently, the code above returns the ASPNET user and not the impersonated user. The person using our component is pretty sure IIS is setup properly, as the same COM object uses SQL Server and windows authentication from within the COM object with no problems.

The following has been added to the web config

<authentication mode="Windows"/>
<identity impersonate="True"/>

IIs has Integrated Windows Authentication enabled and Anonymous Access disabled

Is there any other way of doing this, or am I missing something.