2017-10-03 4 views
0

Ich habe IMS mit WIF 4.5 auf einer MVC-Website eingerichtet. Alle paar Monate ändern die Administratoren das IMS Tokensignaturzertifikat. Sie erwähnten, dass ich die automatische Zertifikatsrotation aktivieren sollte, um meinen Fingerabdruck nicht jedes Mal aktualisieren zu müssen, wenn das Zertifikat geändert wird, aber ich kann nicht herausfinden, wie das gemacht wird. Im Folgenden finden Sie ein Beispiel für Code aus meiner aktuellen Konfiguration in der Datei web.config.So implementieren Sie die automatische Zertifikat-Rotation in WIF 4.5

<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> 

Antwort

0

Es gibt eine vollständige Beschreibung dieser here.

z.B. Wenn Sie die älteren VS-Versionen verwenden, können Sie Folgendes verwenden:

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