如何在 ADFS 2.0 .net 3.5 中配置不同的 Saml2SecurityTokenHandler 進行被動聯合

如何在 ADFS 2.0 .net 3.5 中配置不同的 Saml2SecurityTokenHandler 進行被動聯合

如何在 ADFS 2.0 伺服器上為被動聯合配置其他 Saml2SecurityTokenHandler (Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler) 類別?

現在:我正在嘗試以下配置:

<configuration>
  <configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   ...
  </configSections>
  <microsoft.identityModel>
    <service>       
      <securityTokenHandlers>
        <remove type="Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <remove type="Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add type="ClassLibrary1.Class1, ClassLibrary1" />
      </securityTokenHandlers>
    </service>
  </microsoft.identityModel>
  ...
</configuration>

刪除 <remove> 元素會導致 ADFS 2.0 Windows 服務啟動時出現異常(已新增具有相同金鑰的項目),因此我們可以確定我們的設定已成功載入。但是當使用被動聯合時,我們看到仍然使用預設的 MSISSaml2TokenHandler:

System.IdentityModel.Tokens.SecurityTokenException:MSIS3120:SubjectConfirmationData 的收件者錯誤。預期的 'https://secure.mydomain.com/adfs/ls/'但收到:'https://secure.proxy.mydomain.com/adfs/ls/'。在Microsoft.IdentityServer.Service.Tokens.MSISSaml2TokenHandler.ValidateConfirmationData(Saml2SubjectConfirmationData 確認資料)

當閱讀msdn文檔時(http://msdn.microsoft.com/en-us/library/gg638730.aspx)它似乎已配置為應有的樣子。沒有名稱的 <service> 元素是預設配置,將在被動聯合場景中使用。

請幫我!這是幾週工作的最後一個障礙。

相關內容