【问题标题】:How to Implement Automatic Certificate Rotation in WIF 4.5如何在 WIF 4.5 中实现自动证书轮换
【发布时间】:2017-10-04 02:23:36
【问题描述】:

我在 MVC 网站上设置了带有 WIF 4.5 的 IMS。每隔几个月,管理员就会更改 IMS 令牌签名证书。他们提到我应该能够启用自动证书轮换,以便不必在每次更改证书时都更新我的指纹,但我似乎无法弄清楚这是如何完成的。下面是我在 web.config 中当前配置的代码示例。

<system.identityModel xdt:Transform="Replace">
<identityConfiguration>
  <audienceUris>
    <add value="http://tools.mycompany.com/myapp/" />
  </audienceUris>
  <issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
    <authority name="https://ims.mycompany.com/">
      <keys>
        <!-- Expires on 10/23/2017 -->
        <add thumbprint="************" />
        <!-- Begins working on 10/16/2017 -->
        <add thumbprint="************" />
      </keys>
      <validIssuers>
        <add name="https://ims.mycompany.com/" />
      </validIssuers>
    </authority>
  </issuerNameRegistry>
  <!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
  <certificateValidation certificateValidationMode="None" />
  <securityTokenHandlers>
    <remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </securityTokenHandlers>
</identityConfiguration>

【问题讨论】:

    标签: c# web-config wif


    【解决方案1】:

    有这个here的完整描述。

    例如如果您使用较旧的 VS 版本,则可以使用:

    protected void Application_Start() { AreaRegistration.RegisterAllAreas(); ... RefreshValidationSettings(); }
    

    【讨论】:

      猜你喜欢
      • 2014-05-30
      • 2018-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-28
      • 1970-01-01
      • 1970-01-01
      • 2014-08-23
      相关资源
      最近更新 更多