我正在寻求使用SSL和客户端证书身份验证来保护ASP.NET MVC应用程序.我正在使用IIS 7.5,Windows Server 2008 R2.
我想知道是否可以通过Web.config执行以下操作(它必须通过那里!)
此外,关于如何继续执行此操作,任何教程或其他相关资源的任何指示都将非常受欢迎,因为我几乎所有这些事情都是新手.
所以,回答我自己的问题..以上所有都可以通过Web.config实现.Web.config的以下部分需要通过系统/访问部分进行SSL,并配置多对一客户端证书映射.这些部分被锁定在applicationHost.config中,因此任何希望在Web.config中编辑它们的人都需要解锁它们.有很多教程,所以我不会进入它.
<security>
<access sslFlags="Ssl, SslNegotiateCert" />
<authentication>
<anonymousAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="true" manyToOneCertificateMappingsEnabled="true">
<manyToOneMappings>
<add name="Authentication Certificate"
enabled="true"
permissionMode="Allow"
userName="foo"
password="bar">
<rules>
<add certificateField="Issuer" certificateSubField="CN" matchCriteria="*.stackoverflow.com" compareCaseSensitive="false" />
</rules>
</add>
</manyToOneMappings>
</iisClientCertificateMappingAuthentication>
</authentication>
</security>
Run Code Online (Sandbox Code Playgroud)