0
我在Windows Server 2012 R2上運行IIS 8.5。我已將WebAPI(構建於ASP.net上)網站配置爲使用HTTPS(自簽名)與IIS客戶端證書映射進行客戶端證書身份驗證。我正在使用ManyToOneMapping,我已經定義了一個本地帳戶與傳入請求關聯的客戶端證書。此外,我在映射中定義了一個規則,以便如果證書中的「主題」字段包含某個字符串,則它應該允許請求。IIS客戶端證書映射規則不受尊重
現在,當我點擊API應用程序中的url時,Firefox會提示我選擇要使用的證書(如預期的那樣)。並且,當我選擇其中一個不包含包含該映射規則中定義的字符串時,瀏覽器是仍然服務與資源。我預計會有一個禁止迴應。所以,看起來客戶端證書映射不能按預期工作。
由於我是新手,我想知道如何才能找到如何解決這種情況。提前致謝。
下面是從ApplicationHost.config文件片段:
<location path="SimpleApi" overrideMode="Allow">
<system.webServer>
<security>
<authentication>
<iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="false">
<manyToOneMappings>
<add name="Authorized Access" description="Some long description" userName="SomeUser" password="[enc:AesProvider:removed:enc]">
<rules>
<clear />
<add certificateField="Subject" certificateSubField="OU" matchCriteria="Admin" />
</rules>
</add>
</manyToOneMappings>
<oneToOneMappings />
</iisClientCertificateMappingAuthentication>
</authentication>
</security>
</system.webServer>
</location>
<location path="SimpleApi">
<system.webServer>
<security>
<access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
</security>
</system.webServer>
</location>