Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharepoint Web Service Credentials Issue

Status
Not open for further replies.
Jun 24, 2005
109
GB
Hi all,

I apologies in advance if this is a really basic question, but its completely stumping me!!

I have an ASP.NET application running on one of our servers, which sends a few Web Service requests to our Sharepoint site. I'm trying to use windows integrated authentication to determines access to these web services (as opposed to saving a password in my code).

To cut a long story short I cant seem to get it to work! I have the following settings in my web.config file:

Code:
<authentication mode="Windows" /> 
<identity impersonate="true" />

And have annonymous access switched off in our IIS, but it still doesnt work.

If I hard code in some credentials the application works fine. Am I missing something simple?

thanks in advance

Matt
 
Hmmmm... If you have your anonymous access set up right in IIS, it should be working... You can also explicitly set the impersonated user in your config:

Code:
<identity impersonate="true"
userName="domain\user" 
password="password" />

Keep in mind, impersonation isn't without its restrictions.... It is possible (depending on what your actually doing) that impersonation alone may not be enough. If I were you I would set a break-point in your app when it is first launched and verify the impersonated identity isn't working (by checking the user identity). If in fact it is the impersonated user, then you need to isolate your application in its own app pool (in IIS) and set the app pool to run under the desired credentials.

Hope this helps.


Kevin Davie
Consultant
Sogeti USA
 
Just been reading up on this a bit and would I be setting the credentials right on the web service by calling:

Code:
ListSerivceObject.Credentials = Net.CredentialCache.DefaultCredentials

I;ve read in some other places that it might be related to credential forwarding and that I might need Kerberos authentication, could this be true?

Cheers for the feedback, I'll have a go at what you mentioned this afternoon.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top