Mat*_*uba 3 javascript c# asp.net ssl digital-certificate
我需要在浏览器上打开此 JavaScript 证书模态,以便用户选择他们的证书(抱歉,这是葡萄牙语):
然后Action像这样保存在我的身上:
[HttpGet]
public ActionResult GetClientCertificate() {
var requestCertificate = System.Web.HttpContext.Current.Request.ClientCertificate;
///Transform to byte[] and save on DataBase
}
Run Code Online (Sandbox Code Playgroud)
我花了很多时间研究,因为这是我第一次接触这种技术,但不管我做什么,我都无法让它发挥作用。模态永远不会打开并且ClientCertificate总是空的。真的有可能在 JavaScript 上实现这一目标吗?
ISS配置
<access sslFlags="SslNegotiateCert" />
<applicationDependencies>
<application name="Active Server Pages" groupId="ASP" />
</applicationDependencies>
<authentication>
<anonymousAuthentication enabled="true" userName="" />
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="true" />
<digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="true">
</iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="false">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
<authorization>
<add accessType="Allow" users="*" />
</authorization>
Run Code Online (Sandbox Code Playgroud)
JS
$(document).on("click", "#btnCertificate", function() {
$.get("/Gerenciamento/CertificadoDigital/GetCertificate", null, function(data) {
//// Redirect to other page
});
});
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止似乎遇到的问题(有一半没有回答):
| 归档时间: |
|
| 查看次数: |
6046 次 |
| 最近记录: |