title: Error after Fingerprint touched on Samsung phones: android.security.KeyStoreException: Key user not authenticated
body: <p>My app uses Android 6.0 Fingerprint API to protect AES key in the Android KeyStore. The stored key can be used only when user is authenticated by fingerprint sensor because the <code>KeyGenParameterSpec</code> is initialized with <code>setUserAuthenticationRequired(true)</code>. </p>
  
  <p>When the user touches the sensor I get the initialized Cipher from the callback <code>onAuthenticationSucceeded(Cipher)</code> and I use it for decryption. </p>
  
  <p>This works perfectly except on Samsung phones with Android 6. When I try to use the returned Cipher, Samsung phones sometimes throw <code>android.security.KeyStoreException: Key user not authenticated</code>. So even though the Cipher is returned by the <code>onAuthenticationSucceeded(Cipher)</code> the Android KeyStore thinks user was NOT authenticated by the fingerprint sensor. </p>
  
  <p>It seems that the crash happens rather when the app was not used for longer time. When the app is wormed up all is working correctly usually.</p>
  
  <p>As this error happens randomly and only on Samsung phones... It seems it is caused by some internal timing issue inside the Samsung implementation of Android 6.0 KeyStore and FingerPrint API.</p>
  
  <p><strong>Edit</strong>: This issue was also experienced in OnePlus and Acer phones.</p>