RE: search webservice authorization issue
From: Mario (Mario_at_discussions.microsoft.com)
Date: 03/18/05
- Next message: Tjoep: "RE: applications + sharepoint and restrictions"
- Previous message: Wei-Dong XU [MSFT]: "Re: SPS log files are different from WSS log files"
- In reply to: Ken: "RE: search webservice authorization issue"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 17 Mar 2005 23:29:01 -0800
Thanks for your reaction. I tried this method and it works fine. Still, I
think it should work using impersonation, but for the time being, using a
dedicated account is OK for me.
Mario
"Ken" wrote:
>
> It works fine on your local machine with default credentials because you are
> hte logged in user on your local server and have full access as an Admin most
> likely to your local box, however, once you cross your local machine
> boundary, your sending your credentials to the target SPS server, SPS in turn
> is authenticating the request and it's failing, if you do not have your
> account setup on that target SPS as someone that can Search you'll get the
> error your getting now.
>
> In general, I usually create a network credential object, then assign the
> account i want to use to execute a remote search on behalf of a user (rather
> than using the current logged on user credentials, which implies I have their
> account setup in SPS to access Search), something like the following
>
> Dim objCred as New NetworkCredential
>
> objCred.Domain = "targetdomain"
> objCred.UserName = "username_with_access_search_on_sharepoint"
> objCred.Password = "password_with_access_search_on_sharepoint"
>
> 'Windows authentication:
> MySearchSvc.Credentials = objCred.GetCredential(New Uri(objQuerySvc.Url),
> "NTLM")
>
> Now you have a configurable way to access search using any accounts you want
> to have setup. Be careful with this because your adding user names and
> passwords here, only do this in a highly secure environment if you end up
> going that way.
>
> "Mario" wrote:
>
> > I built a webapplication that uses the search webservice of Sharepoint portal
> > Server. On my development machine (server A) it works fine, but when I deploy
> > the application to the intranetserver (server B) the webservice fails. I
> > receive the exception: The request failed with HTTP status 401: Unauthorized.
> > The webservice and SPS run on server C.
> >
> > I authenticate with
> > MySearch.Credentials =
> > System.Net.CredentialCache.DefaultCredentials
> > MySearch.PreAuthenticate = True
> > where MySearch is the webreference to the webservice.
> > In the web.config I use <identity impersonate="true" /> and deny anonymous
> > requests.
> >
> > Can someone help me?
> >
> >
> > --
> > Mario Delamboy
- Next message: Tjoep: "RE: applications + sharepoint and restrictions"
- Previous message: Wei-Dong XU [MSFT]: "Re: SPS log files are different from WSS log files"
- In reply to: Ken: "RE: search webservice authorization issue"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|