google-chromeauthenticationsslcertificatessl-client-authentication

Digital certificates in chrome


I have the following case in a web application of mine. The usual browser that the user uses is Chrome.

I use digital certificates that users have cryptographic cards that they insert into a card reader.

To log in to the application, basically users access the https link that makes the certificate data read.

So far everything works fine.

If the user to end his session of the application closes the browser, there is no problem. Everything is over.

But if the user wants to leave his application session, without closing all browser windows, here are my problems.

There is a button that closes the session of the application, the user leaves and redirects to the initial login screen. It seems that everything has been reset, because the user has left. But when the new user wants to log in and press the link to read the certificate data, instead of doing a new reading of the new card, use the data from the previous card without just asking for the pin to access it.

The problem goes further, for example, if the user has forgotten the card, the card and tries to logarize, the failure to read the certificate. But now, although inserted correctly, the card will not be read again until the browser is restarted, which maintains a cache that does not have a certificate.

At the moment only the solution was found by closing all Chrome windows, but that depends on whether the user does or not.

A partial solution would be sure to close the browser with javascript () but for some time, it can not be closed with javascript (window.close ()), a window that can not be opened from the site itself, with what is available I think it's ruled out

Can someone contribute to me? Thank you


Solution

  • Chrome and the rest of browsers maintain a cache of the SSL authentications performed and decide when to prompt user for selecting a certificate. There is no "logout" function neither the connection can be closed from server side due to TLS resumption protocol ( client can resume the session)

    This a common and known issue when defining an authentication system using client certificates. I only have found a workaround: use different domains to force browser to choose a certificate:

    login.domain.com
       -->login1.domain.com
       -->login2.domain.com
    
       -->loginN.domain.com
    

    You have a virtual authentication URL login.domain.com which redirects user's browser to a random loginN.domain.com every time you need an authentication. Chrome will detect that it is a different domain and will prompt user for selecting a certificate

    You could also think about using different ports instead of different DNS, but then you could have problems with the user's firewall because you are not using a standard port, and in this case Firefox does not show the window either.