I have making test on my app to allow users to login with its digital certificate.
This is not complicated as it requires just one line to actually retrieve data from a magnet card.
This is how I am requesting the data:
@{
string certDados = Request.ClientCertificate.Subject;
string[] dataArray = certDados.Split(',');
string data = dataArray.Last();
string[] numberArr = data.Split(':');
string number = numberArr.Last();
}
<td>Utilizar Cert. Digital</td>
<td>@Html.CheckBox("hasDigital")
@number
</td>
The problem is… I can´t get the number all the time. Sometimes the number is there, sometimes not. If I refresh the page a couple of times it appears, and next time I refresh it is not there..
Is there something I could do to solve this problem?
Found a solution..
Now it is working… ;O)