如何使用Kerberos身份验证从c#客户端调用Sharepoint Webservice?

时间:2021-05-06 19:48:40

We have developed a webservice that sits and runs in the context of a sharepoint site. This works fine using normal windows authentication.

我们开发了一个在sharepoint站点环境中运行的Web服务。使用普通的Windows身份验证可以正常工作

We now have a client who wants to install this on a Kerberos enabled sharepoint site. What changes would we need to make to either the webserivce, the calling client (a windows service) or both to enable this...?

我们现在有一个客户端想要在启用Kerberos的sharepoint站点上安装它。我们需要对webserivce,调用客户端(Windows服务)或两者进行哪些更改才能启用此功能?

1 个解决方案

#1


5  

Is this in an intranet?

这是在内联网吗?

If so, and your client is already passing windows credentials to the web service, you shouldn't have to do any additional work.

如果是这样,并且您的客户端已经将Windows凭据传递给Web服务,则您不必执行任何其他工作。

If you aren't passing windows credentials, here is how to do it :

如果您没有传递Windows凭据,请按以下步骤操作:

WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol

proxy.Credentials = CredentialCache.DefaultCredentials;

This method works for both NTLM and Kerberos authentication. It will pass the credentials of the windows account under which the code is running.

此方法适用于NTLM和Kerberos身份验证。它将传递运行代码的Windows帐户的凭据。

#1


5  

Is this in an intranet?

这是在内联网吗?

If so, and your client is already passing windows credentials to the web service, you shouldn't have to do any additional work.

如果是这样,并且您的客户端已经将Windows凭据传递给Web服务,则您不必执行任何其他工作。

If you aren't passing windows credentials, here is how to do it :

如果您没有传递Windows凭据,请按以下步骤操作:

WebServiceProxy proxy = new WebServiceProxy(); // Derived from SoapHttpClientProtocol

proxy.Credentials = CredentialCache.DefaultCredentials;

This method works for both NTLM and Kerberos authentication. It will pass the credentials of the windows account under which the code is running.

此方法适用于NTLM和Kerberos身份验证。它将传递运行代码的Windows帐户的凭据。