Fengzhimei@Dot.Net
Designing My Colorful Dream
posts - 78,  comments - 191,  trackbacks - 3

    I recently ran into a big problem when I work on my ListAggregation webpart, the webpart need to pull some lists data from remote Wss site into my local Wss site, these two servers are not in the same domain, and all use the NTLM credential. So I desided to use the lists.asmx webservice to finish this task. In my webpart, I used System.Net.CredentialCache.DefaultCredentials to get the webservice credential, but when I deployed my webpart to my site, I got "The request failed with HTTP status 401: Access Denied." error. I really had no idea about this exception, but the error info indicates that it is about the permission problem, then after many times google, I just realised it is the security issue known as "double-hop". The "double-hop" issue will raise "if your webservice exists on another server than your SPS the client sends it credentials to the SPS-server (first hop) which tries to forward the credentials to the webservice server (2nd hop)"(Quoted from http://msmvps.com/obts/archive/2005/01/18/33146.aspx).

    But fortunately I found that there are several approachs finally, which can handle the "double-hop" issue:
    1. Give a specific credential, to do this, you need to create a NetworkCredential instance, and pass the specific "name","password","domain" as the parameters.
    2. Enabling delegation. Take a look at this for more detail.
    3. Create a COM+ component to encapsulate required functionality, refer to this article.
    4. Basic Authentication (you need to use HTTPS as the security reason)

   But I recommend the first method, but basically it is not so secure when you store your alias and password in the web.config, but you can encrypt the userName and password  and store in the registry, then you need some configuration steps to get the encrypt info, to accomplish this, please refer to http://support.microsoft.com/default.aspx?scid=kb;en-us;329290. And why I don't want to use the second mothed and the third method, about the second method, just as Nunos said, "You'll need to ask a domain admin to do this and normally they don't really like to accept this type of request". And about the third method, I think it is doable but you have to make more work and it is hard to deploy.
    Hope this helps.
posted on 2005-08-03 19:54 fengzhimei 阅读(2074) 评论(1)  编辑 收藏 网摘 所属分类: Asp.netSharepointWebservice

FeedBack:
2005-09-24 12:27 | ralin [未注册用户]
when i cal web service ,login the page ,the page show me "The request failed with HTTP status 401: Access Denied",now i google the info,but i did not to solution
  回复  引用    




标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2005-08-22 10:36 编辑过
Google站内搜索
[推荐职位]上海盛大网络招聘架构师

China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
开发者征途系统新作:《设计模式——基于C#的工程化实现及扩展》

相关文章:

相关链接:

 

Would you like to share your thought? Would you like to make friends with me? Just contact me:)
These postings are provided "AS IS" with no warranties, and confer no rights.
Translate this page to chinese
Locations of visitors to this page

<2005年8月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910

与我联系

搜索

 

常用链接

留言簿(9)

随笔分类

随笔档案

收藏夹

.Text Skin

Blog I Read

Cool Tools

Exchange Bloggers

Game

Javascript

My Friend

Others

Regular Expression

SharePoint Bloggers

SOA

Sqlserver

积分与排名

  • 积分 - 113162
  • 排名 - 394

最新评论

阅读排行榜

评论排行榜