Skip to content

Instantly share code, notes, and snippets.

@kypflug
Created April 12, 2016 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kypflug/50c6f83a4bf4f7773cfbee36b41e41dc to your computer and use it in GitHub Desktop.
Save kypflug/50c6f83a4bf4f7773cfbee36b41e41dc to your computer and use it in GitHub Desktop.
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