-
-
Save kypflug/50c6f83a4bf4f7773cfbee36b41e41dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAssertion() { | |
try { | |
var challenge = getChallengeFromServer(); | |
var allowList = | |
[ | |
{ | |
type: 'ScopedCred', | |
id: getCredentialID() | |
} | |
]; | |
var timeout = { }; | |
var ext = { }; | |
window.webauthn.getAssertion(challenge, timeout, allowList, ext) | |
.then(function(assertion) { | |
// Send signed challenge and meta data to server | |
sendToServer(assertion); | |
}, function (e) { | |
// No credential in the store. Fallback to password | |
}); | |
} catch (ex) { | |
// Log failure | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment