Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2003, 07:54 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Indexing Service

I having been trying to implement a company intranet with full searching of files throughout the companies domain.
I have been running into problems when I try to search from any machine but the one the asp page is located on.

To summarise(or explain in depth) :

I have a webserver with my search page running.
This page connects to the indexing services on other renote machines using the msidxs provider.
The IIS permissions are set to integrated windows authentication.
The page when searched from the web server returns results with the correct security permissions.
When the page is accessed from a remote machine (in the correct domain) I get a returned message of :

Invalid Catalog Name 'CATALOGNAME' SQLSTATE=42000

My ASp code briefly looks like this (only showing the connect and search bits)

Code:
    set AdoConnection = Server.CreateObject("ADODB.Connection")
    set AdoCommand = Server.CreateObject("ADODB.Command")
    AdoConnection.ConnectionString = "provider=msidxs"
    AdoConnection.Open 
    set AdoCommand.ActiveConnection = AdoConnection

    SelectColumns = ' relevant columns from indexing service
    SelectString = "Select " + SelectColumns + " from (Table remotemachine1.CatalogName..Scope() 
        UNION ALL TABLE remotemachine2.CatalogName..Scope()) " 

    Composer = ""
    TheQuery = ""

    if SearchString <> "" then
        TheQuery = "Contains('""" + SearchString + """')"
        Composer = " and "
    end if

    if Author <> "" then
        TheQuery = "Contains(DocAuthor,  '""" + Author + """') " + Composer + TheQuery
        Composer = " and "
    end if

    if Modified <> "" AND Modified <> "any" then
        if FMMod <> "since" then
            TheQuery = "(Write > " + Modified + ") " + Composer + TheQuery
        else
            TheQuery = "(Write > '" + ModifiedDate + "') " + Composer + TheQuery
        end if
    end if

    if TheQuery <> "" then
        SelectString = SelectString +  " where " + TheQuery +" "+ SortBy
    else
        SelectString = SelectString + SortBy +" "
    end if

    AdoCommand.CommandText = SelectString

    set RS = Server.CreateObject("AdoDB.Recordset")

    if MaxResults <> -1 then
       RS.MaxRecords=MaxResults
    end if
    RS.Open AdoCommand
Any help would be greatly appreciated, I have been stumped for a day or so and am begining to feel stupid,

Cheers

Dan
 
Old September 8th, 2003, 03:40 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The context in which the query runs has to have access to the network in order for the query to a remote machine to work.

With Windows Integrated authentication, the identity in IIS is such that it can't be used to get on the network. This is actually a security feature. Otherwise you could write an app on your IIS machine that steals the context and reads/sends mail or anything else in the context of the user issuing the query. Very dangerous.

There are a few work-arounds.

1) Use BASIC authentication. That way IIS has the password of the user and can logon the network to issue the query. With Integrated authentication there is no password, only a token. But BASIC is inherently kind of unsafe.

2) Use anonymous authentication and a domain account for anonymous. You lose security, though. The domain account can hop on the network whereas the default IIS anonymous account is local and can't.

3) Enable delegation in Active Directory and use that. Most people don't like this option because it allows some of the security holes mentioned above.

In short, there is no great solution. Allowing any kind of scenario to work will open up security problems -- you need to decide which risks are acceptable.





Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the alternate to windows indexing service hyder_master ASP.NET 2.0 Professional 0 January 22nd, 2008 02:21 AM
how to restart the windows indexing service catalo hyder_master ASP.NET 2.0 Professional 0 January 18th, 2008 03:18 AM
VB.NET 2005 Indexing Service alex1985 Visual Studio 2005 0 April 11th, 2007 05:07 AM
Indexing Service and ASP.NET 2.0 Master Pages thenoseknows ASP.NET 2.0 Professional 1 September 15th, 2006 09:35 AM
ASP and Indexing service sebastian Classic ASP Professional 1 August 28th, 2003 02:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.