【问题标题】:How to call web service that requires claims based authentication?如何调用需要基于声明的身份验证的 Web 服务?
【发布时间】:2012-05-11 00:16:09
【问题描述】:

我有一个想要调用 Web 服务的客户端。 我有一个 web service(asmx) ,一个可以显示声明的 default.aspx 。 我有一个我的 Web 服务信任的测试 STS。 我测试过,sts 可以发送正确的声明,如果我通过显示声明的 default.aspx 页面,Web 服务似乎也能得到它们。我为客户端创建了一个代理(使用 Visual Studio“添加服务引用”)来调用 Web 服务。我找不到有关如何以编程方式从客户端调用 Web 服务的方法,以便它将通过我的 STS 进行身份验证。我像下面这样调用,但 sts 将声明响应返回给客户端,它应该返回到 Web 服务并调用 Web 服务函数。

MyClient =  MyWebServiceSoapClient("MyWebServiceSoap", "http://127.0.0.1:81/MyService.asmx?whr=http%3a%2f%2flocalhost%3a25919%2fteststs%2fdefault.aspx%3fwa%3dwsignin1.0%26wtrealm%3dhttp%3a%2f%2f127.0.0.1%3a81%2fmyservice.asmx");
MyClient.MyServiceFunction();

【问题讨论】:

    标签: web-services wif claims-based-identity sts-securitytokenservice


    【解决方案1】:

    查看 Identity Training Kit 中的示例或“A Guide to Claims based Identity”中的示例。

    【讨论】:

      【解决方案2】:

      我编写了一个 C# 库,使您能够从第 3 方 STS 和随后的 ADFS 获取 SAML 令牌,以最终向 SharePoint 进行身份验证。它可能会有所帮助:

      http://www.huggill.com/2012/02/04/claims-proxy-a-c-sharp-library-for-calling-claims-protected-web-services/

      【讨论】:

      • 感谢分享,遇到问题的时候写过类似的东西。
      猜你喜欢
      • 2013-10-24
      • 2011-03-02
      • 2011-02-07
      • 2015-12-05
      • 1970-01-01
      • 2012-12-07
      • 1970-01-01
      • 2014-04-14
      • 1970-01-01
      相关资源
      最近更新 更多