首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >W3C (IIS)日志记录不记录WCF服务的ClaimsIdentity用户名。

W3C (IIS)日志记录不记录WCF服务的ClaimsIdentity用户名。
EN

Stack Overflow用户
提问于 2016-02-03 07:22:08
回答 1查看 358关注 0票数 2

我的前端key应用程序(MVC)使用一个承载密钥(SAML)对WCF后端服务器进行身份验证。身份验证工作良好,ClaimsIdentity对象被正确设置。但是,ClaimsIdentity的用户名不会出现在W3C IIS日志记录中。在前端,用户名是(IIS W3C)日志记录的一部分,它不会出现在WCF服务中。

前端日志记录:

2016-02-02 16:10:24 xxx.xxx邮政/移动/任务/任务/ 443 Wit.329406069 xxx.xxx 200 0 0 5 97 17504 937

后端日志记录:

2016-02-02 16:10:24 xxx.xxx POST /services/TaskService.svc-443-xxx.xxx- 200 0 1118 9239 765

后端日志记录中缺少用户名。

下面是我使用的绑定:

代码语言:javascript
复制
<ws2007FederationHttpBinding>
<binding>
  <security mode="TransportWithMessageCredential">
    <message issuedKeyType="BearerKey" establishSecurityContext="false">
      <tokenRequestParameters>
        <trust:SecondaryParameters xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
          <trust:KeyType xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
          <trust:SecondaryParameters xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
            <trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
            <trust:CanonicalizationAlgorithm>http://www.w3.org/2001/10/xml-exc-c14n#</trust:CanonicalizationAlgorithm>
            <trust:EncryptionAlgorithm>http://www.w3.org/2001/04/xmlenc#aes256-cbc</trust:EncryptionAlgorithm>
          </trust:SecondaryParameters>
        </trust:SecondaryParameters>
      </tokenRequestParameters>
    </message>
  </security>
</binding>

EN

回答 1

Stack Overflow用户

发布于 2016-02-03 10:19:38

IIS只能在使用Windows/basic (和其他几种)身份验证方法时记录用户名。

在您的示例中,IIS使用匿名身份验证,应用程序处理真正的检查。因此,IIS不记录任何信息,您必须使用自己的日志记录来跟踪用户。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35170821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档