We have a microservice-based system and currently users are authenticated by keycloack(jwt) and we need to add biometrics login in this existing system. At first, we have designed a biometrics authentication flow as below:
- Generate Asymmetric Key Pair at the client end(mobile app).
- Share the public key with backend server.
- Encrypted the authentication token(jwt access token generated from keykoack, generated initially from password login) with the public key at the backend server.
- Share the encrypted token to the mobile app and save it locally at the device.
- Use biometric APIs to get access to the private key.
- Decrypt the encrypted token and use it for further authentication.
But where I got a problem is what to do when:
- the access token get expired?
- Even if the life-span of the token is exceeded, what to do if the token policies have to be updated on the way?
My questions are:
- Is this flow correct & makes sense? (flow referenced from: reference thread)
- What are the best practices that are being taken for biometrics authentication in similar circumstances like above or how popular apps are implementing biometrics any references?
I'm trying to solve this since last week but no luck. I would really appreciate the suggestion, tips, help.