|
| |||||||||
| Tags: c code, certificate, datagridview, map |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to map a certificate to a user via C#
Hi, I'm busy writing a program which reads a certificate from a card (the belgian eid card) and that certificate has to be mapped to a user that has been selected in a datagridview. I have tried with: entry.Properties["userCertificate"].Add(x509.getRawCertData()); entry.Properties["userCert"].Add(x509.getRawCertData()); I had no luck with these... I never saw the certificate being mapped. I then looked for a function which showed all the propertynames and values of a specific entry. There I found that a user who had a certificate mapped to his account had a property "altSecurityIdentities". When I added a value to that property I saw I had mapped a certificate to my account. The value was made by data which is retrieved from the certificate I got from the card. This is the format: object altSecId = x5092.GetFormat() + ":<I>" + x5092.GetIssuerName() + "<S>" + x5092.GetName(); Now I did the real test. I made sure I had no certificate mapped to my account. I also made sure the property's "userCertificate" and "userCert" had no more values. Then I tried to login to a website. The result was as I expected. I could not login. I got an error telling me that the client certificate did not match the user credentials. I expected this one. Then I mapped a certificate to my account via my C# code. I expected I would be able to login but got the same error message as the previous test. My client certificate did not match the user credentials I entered. So this was not expected as I saw my certificate being mapped to my account. My final test was to make sure that if I mapped my certificate manually I'd be able to login. So I mapped it manually. I tried to login. I was successful as I expected. Now I can't solve the issue as why I can't login when I map my certificate via C# code. I see it's mapped, but it doesn't do anything... So something is probably still missing :s Hope some of you guys hava experience with this. If you want to see code or something don't hesitate to ask ;) |
|
#2
| |||
| |||
| Re: How to map a certificate to a user via C#
Hello, I'm facing the same problem. Can you tell me how did you resolve it. Thank you, Cristina |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to map a certificate to a user via C#" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unable to install the security certificate while logged in as a domain user | Harinadhar | Networking & Security | 4 | 23-03-2011 09:16 PM |
| Windows 2003: Issue user certificate on behalf of a user | Jeremy Wiebe | Active Directory | 4 | 29-03-2010 01:33 PM |
| CA Question - Web Enrollment User Certificate | Chris M | Active Directory | 3 | 12-11-2009 08:57 PM |
| Renewal root certificate authority, what happens to user certifica | NICO Rodriguez Sanchez | Active Directory | 1 | 05-03-2009 05:08 PM |
| How to assign a User certificate to an ADAM User. | sh | Active Directory | 3 | 11-02-2009 02:14 AM |