The Objective
I need to open this JavaScript certificate Modal on Browser to user select their Certificate (It's on Portuguese sorry):
Then save it on my Action
like this:
[HttpGet]
public ActionResult GetClientCertificate() {
var requestCertificate = System.Web.HttpContext.Current.Request.ClientCertificate;
///Transform to byte[] and save on DataBase
}
The Problem
I have spend a lot of time researching because it's my first contact to this kind of Technology, but no metter what I do, i can't make it work. Modal never open's and ClientCertificate
is always empty. It's really possible to achive this on JavaScript?
Context
ISS Config
<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>
JS
$(document).on("click", "#btnCertificate", function() {
$.get("/Gerenciamento/CertificadoDigital/GetCertificate", null, function(data) {
//// Redirect to other page
});
});
Links
This are the questions that I had seem so far (half of then unanswered):