-
Notifications
You must be signed in to change notification settings - Fork 70
Description
The first use case of web crypto, mentioned by the specs is multi factor authentication:
https://www.w3.org/TR/WebCryptoAPI/#multifactor-authentication
Since biometrics / PIN access is used in native apps as a second factor to crypto operations (implemented by web crypto on the web), I think web crypto standard would be the right place to standardize a simple biometrics / PIN check (above different native platform APIs) like (just an inital suggestion):
subtle.crypto.verifyUser(option, timeout = 100_000)
- where option is an enum: STRONG, ANY (referring to stronger methods like faceid or fingerprint or any methods like drawing something or weaker face unlock)
- timeout is the timeout in millisec
- result is a promise with true or false
This would be like a second factor for any (!) crypto operation where it makes sense: like signing challenges or decrypting data.
Example use cases (2):
-
A web app (even operating offline), having been signed in with any methods, may have encrypted sensitive user data in indexed db (with WEB CRYPTO: unextractable decryption key). The web app is capable of decrypting and showing this sensitive data to the device operator, but with biometrics check, we could add a 2nd factor to EXISTING WEB CRYPTO USE CASES, and only for the device owner(!) would it be possible to use the decryption key.
-
A web app that utilizes WEB CRYPTO private keys for device authentication can now make the browser sign a challenge with an (unextractable) private key before doing some sensitive action on server like downloading or deleting sensitive things (the successul signing with the private key practically refreshes an access token before performing sensitive operations). Same here, with a second factor, only the device owner would be able to do these things and not anybody that currently operates the signed in device.
Apple, Google, Microsoft platforms have different classification of "device unlock" security levels, it would be great to achieve a good definition of what is considered STRONG.