【问题标题】:Passing Windows User 'Token' to WCF to authenticate将 Windows 用户“令牌”传递给 WCF 进行身份验证
【发布时间】:2012-09-02 20:01:11
【问题描述】:

有人知道我如何传递“令牌”吗?向 WCF 服务验证 windows 用户是否有效?

我想编写一个 wcf 服务,该服务可以使用 U/P 组合或 Windows 登录来进行身份验证服务,该服务将返回其自己的标准令牌。我的想法是 Windows 身份验证只是我的服务可以支持的一种方法。

我看到了针对 ADFS 验证用户名和密码,但我没有密码.. 只有用户名。

【问题讨论】:

  • 嗨。我有同样的问题。但是我没有通过搜索找到任何合适的解决方案。 (我搜索了很多)。你能告诉我你找到的最终答案吗?非常感谢。

标签: c# .net active-directory


【解决方案1】:

您可以在 serviceModel 配置中为您的服务的两端指定 Windows 凭据类型。

<system.serviceModel>
<bindings>
    <wsHttpBinding>
        <binding name="httpService">
            <security mode="Message">
                <message clientCredentialType="Windows" algorithmSuite="Default" />
            </security>
        </binding>
    </wsHttpBinding>
</bindings></system.serviceModel>

http://msdn.microsoft.com/en-us/library/ms733836.aspx

您还需要适当地配置 IIS。

http://msdn.microsoft.com/en-us/library/aa292114(v=vs.71).aspx

【讨论】:

    猜你喜欢
    • 2015-02-24
    • 2011-02-06
    • 2019-06-16
    • 2021-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多