|
Home > Archive > IIS Index Server > March 2005 > Impersonation, OLEdb, and Indexing service problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Impersonation, OLEdb, and Indexing service problem
|
|
| J. Gaskins 2005-03-08, 5:51 pm |
| I am having a problem with a call to indexing service via OLEdb, as it
relates to impersonation. Not sure if this is the right forum, but I thought
I'd ask it here, since the impersonation error only occurs when utilizing
OLEdb. I am using WinXP PRO SP1, Indexing service works up until I call the
OLEdb.
For example... assuming you have Indexing service running, and have active
catalogs...
Impersonation is set to true in the Web.Config via
<identity impersonate="true" />
----
Dim usrIdxServerAdmin As New CIODMLib.AdminIndexServer
Dim strQuery As String
strQuery = "Select Rank, Filename, Create, Write, Size, Path from
SCOPE() where FREETEXT('" & TextBox1.Text & "') order by RANK"
' TextBox1.Text is word that you type in the text box to query by
using Index Service.
'
Dim connString As String = "Provider=MSIDXS.1;Integrated Security
..='';Data Source='" & strCatalog & "'"
' strCatalogName is the name of the catalog running under Indexing
Service
Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)
Dim testDataSet As New DataSet
Dim usrRow As DataRow
cn.Open()
strUserName =
System.Security.Principal.WindowsIdentity.GetCurrent().Name()
' strUserName is just a string, and I am using this to debug.
' On this side of the call, the username impersonated is CORRECT
cmd.Fill(testDataSet)
strUserName =
System.Security.Principal.WindowsIdentity.GetCurrent().Name()
' On this side of the call, the username impersonated is INCORRECT.
' It switches to the ASPNET account
cn.Close()
RowCount = testDataSet.Tables(0).Rows.Count ' full of Rows of data
For Each usrRow In testDataSet.Tables(0).Rows
If usrIdxServerAdmin.IsRunning Then ' FAILS DUE TO USERNAME SWITCH
' data manipulation
End If
Next
I actually use the Indexing service via impersonation in other parts of the
application, and it works exactly as it should. BUT, when I try and fill the
dataset, the impersonation drops back to the ASPNET account (which does not
have access rights to the Indexing Service). This is frustrating. The bad
part about it, is that Microsoft put out a KB article on this issue -
http://support.microsoft.com/kb/323293 - and claims that it is fixed in
Windows 2000 SP 4 and .NET framework 1.1 (which I am running). Has anyone run
into this issue, and (more importantly) has anyone fixed this problem? As I
said, the 'switch' in users ONLY occurs when the OLEdb call is made. ANY
suggestions would be appreciated. I do NOT want to give the ASPNET account
System permission (which was the work-around Microsoft suggests in the KB
article.
I see that there are a couple other people who have posted an almost EXACT
same problem without any solution posted. Any help would be appreciated.
--
J. Gaskins
|
|
|
|
|