Nexus Personal (Hardware) Tokens but most of the points can be extended to other types of tokens.
We can use the Javascript API provided by the company which makes the token.
The code above has to be added to the page in order to enable browser-token communication.
In this case the API for Nexus Personal Tokens is named websigner (Websigner Documentation).
Here’s a sample code showing how we use the API to interact with the token:
There’s an API which uses ActiveX and there’s another one based on Mozilla NPAPI. I’m going to skip the details here, if you’re going to implement this part and need help, contact me. The scenario is that the web server generates a random number and sends it to the client, the client uses websigner2 api and asks the token to sign the number. The middleware installed on the computer asks the user to enter the pin and then the token signs the number, the signed value is then sent back to the server and the possession of private key is proved to the server. One gotcha here is that the server has to make sure the same number isn’t sent to the clients twice. So we either save it somewhere in the database or have the pool be large enough so that the chance that two generated numbers collide is negligible.
If you choose to implement the client authentication in layer 7 (the javascript API) you will have to change your application to authenticate the clients using this new method. If you’re planning to add this feature to an existing website or to a CMS you may have a hard time. (There’s another route though)
Implementing client certificate authentication using TLS might be an easier route to take because your application will undergo low or no change at all. Let’s look at this feature under IIS.
3. For ease of use and configuration, install UI Module for Client Certificate Mapping. “Client Certificates” icon will show up as indicated in the image.
Enabling Client Certificates
Now the user is prompted to enter the pin of his token when he enters our site, and upon successful authentication he’ll be granted access to view the pages.
403.7 – Client certificate required.
This error is shown when the client hasn’t connected his token or didn’t supply his certificate.
403.13 – Client certificate revoked.
This error can be tricky at times…
Now chances are you are setting up a development environment and don’t have valid certificates or the connection to OCSP/CRLDP isn’t available at the moment and you want to go ahead and test your application, you can disable CRL check and make the web server only verify the certificate fields and the signature.
In order to do this enter “netsh http show sslcert” and find the application Id of “{4dc3e181-e14b-4a21-b022-59fc669b0914}” which corresponds to IIS. CRL check is enabled by default when you configure a web application on IIS. Now in order to disable this feature you will have to remove your current https binding and add another one.
Write down certhash and appid of your current binding, you will use these items later.
To remove current binding:
“netsh http delete sslcert ipport=0.0.0.0:443”
(change ipport configuration to point to your current binding)
To add new binding with CRL check disabled:
“netsh http add sslcert ipport=0.0.0.0:443 certhash=40db5bb1bf5659a155258d1d007c530fcb8996c2
appid={4dc3e181-e14b-4a21-b022-59fc669b0914}
certstorename=My verifyclientcertrevocation=disable”
(modify certhash and appid to point to the value you wrote down previously)
Now the CRL won’t be checked and you won’t see 403.13 error anymore.
In the upcoming blog posts I’ll discuss about how Client Certificate Authentication functions under SSL/TLS protocol and the issues you’ll face when you want to intercept the traffic in network security devices such as WAFs (Web Application Firewall).