WebAuthN is a way to authenticate web applications by using your device's method of authentication (e.g. PIN, fingerprint, pattern, face,...). This can be used as an extra factor or maybe even replace passwords.
The Web Authentication API (WebAuthN) is an extension of the Credential Management API (aka FIDO) which allows the use of USB devices (like a YubiKey) to allow authentication.
Relying Party - The entity whose web application utilizes the WebAuthN to register and authenticate users.
Authenticator (Client Device) - Devices that support WebAuthN (e.g. phones, security keys, computers, etc...)
FIDO (U2F) - Universal 2-Factor is an open authentication standard that enables internet users to securely access any number of online services with one single security key instantly and with no drivers or client software needed.
FIDO2 - The standard for WebAuthN. A backwards compatible extension of FIDO.
Mozilla Firefox, Google Chrome, and Microsoft Edge have all announced support.
https://caniuse.com/#search=webauthn
https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API#Browser_compatibility
//Register
navigator.credentials.create(publicKeyCredentialCreationOptions)
//Authenticate
navigator.credentials.get(PublicKeyCredentialRequestOptions)
/* Credentials and other parameters need to be of the type ArrayBuffer */
//String to Binary
function strToBin(str) {
return Uint8Array.from(
atob(str),
function(c){ return c.charCodeAt(0); }
);
}
//String to ArrayBuffer
strToBin(str).buffer
//Binary to String
function binToStr(bin){
return btoa(new Uint8Array(bin).reduce(
function(s, byte){ return s + String.fromCharCode(byte); }
, ''
));
}Memorized things that we all are forced to use.
Problems:
Rotating codes make authentication more secure than a password alone.
Problems:
Some sites will send codes over SMS or through a robocall.
Problems:
There are devices that can authenticate using USB, NFC, or Bluetooth. The use FIDO and have similar benefits to WebAuthN.
Problems:
WebAuthN is a way to authenticate web applications by using your device's method of authentication (e.g. PIN, fingerprint, pattern, face,...)
The Web Authentication API (WebAuthN) is an extension of the Credential Management API (aka FIDO) which allows the use of USB devices (like a YubiKey) to allow authentication.
var publicKeyCredentialCreationOptions = {
publicKey: {
rp: { // Relying Party (a.k.a. - Service):
name: "Acme"
},
user: {
id: new Uint8Array(16),
name: "john.p.smith@example.com",
displayName: "John P. Smith"
},
pubKeyCredParams: [{
type: "public-key",
alg: -7
}],
attestation: "direct",
timeout: 60000,
challenge: new Uint8Array([
// must be a cryptographically random number sent from a server
]).buffer
}
};
navigator.credentials.create(publicKeyCredentialCreationOptions)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin urna odio, aliquam vulputate faucibus id, elementum lobortis felis. Mauris urna dolor, placerat ac sagittis quis.
//Decoding the ClientDataJSON and attestationObject
navigator.credentials.create(publicKeyCredentialCreationOptions).then(r => {
let clientDataJSON = JSON.parse(atob(binToStr(r.response.clientDataJSON)));
let attestationObject = CBOR.decode(r.response.attestationObject);
});
// Including CBOR - https://github.com/paroga/cbor-js
<script
src="https://rawgit.com/paroga/cbor-js/master/cbor.js"
type="text/javascript">
</script>var PublicKeyCredentialRequestOptions = {
publicKey: {
timeout: 60000,
challenge: new Uint8Array([
// must be a cryptographically random number sent from a server
]).buffer,
var idList = [{
id: "", // credential id from registration
transports: ["usb", "nfc", "ble"],
type: "public-key"
}];
},
};
navigator.credentials.get(PublicKeyCredentialRequestOptions)https://webauthndemo.appspot.com/
WebAuthN
YubiCo
https://demo.yubico.com/webauthn/
My attempt https://github.com/mvndaai/webauthn_demo
Support is still in development. Over time it should become more automatic, especially in mobile.
In Chrome look for the flag:
chrome://flags/#enable-web-authentication-api
Mac Chrome can use Touch ID by enabling this flag:
Slides by Jason Mavandi @mvndaai
https://w3c.github.io/webauthn/#registering-a-new-credential
https://fidoalliance.org/