Impersonate + AD

A

Alberto Ortega

Hi, I've got a difficult situation...
Is a website that runs on IIS with Anonymous Authentication, the tag
<identity impersonate="false"> on the Web.config file. So the thread is
executed by user "NT AUTHORITY".
So when I use AD API ( FindOne() ) it works well.
The point is that when I impersonate that user by code (that works well too)
when I execute that function from the AD API it returns an error:

{"Operation Error" } [System.Runtime.InteropServices.COMException]:
{System.Runtime.InteropServices.COMException} System.Object:
{System.Runtime.InteropServices.COMException} _className: null
_COMPlusExceptionCode: -532459699 _exceptionMethod:
{System.Reflection.RuntimeMethodInfo} _exceptionMethodString: null _helpURL:
null _HResult: -2147016672 _innerException: { } _message: "Operation Error"
_remoteStackIndex: 0 _remoteStackTraceString: null _source:
"System.DirectoryServices" _stackTrace: {System.Array} _stackTraceString: "
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_AdsObject()\r\n at
System.DirectoryServices.DirectorySearcher.FindAll(Boolean
findMoreThanOne)\r\n at
System.DirectoryServices.DirectorySearcher.FindOne()\r\n at
Banelco.CSB.DNN.Providers.ActiveDirectory.LdapAuthentication.GetUser(String
username)" _xcode: -532459699 _xptrs: 0 HelpLink: null HResul


Thanks

Alberto Ortega
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top