Skip to content

Commit

Permalink
fix(ProjectPasskeys) : #9981 added rawId, authenticatorData, publicKe…
Browse files Browse the repository at this point in the history
…y, publicKeyAlgorithm, publicKeyId, transport to the newly created cred object.
  • Loading branch information
maduvena committed Nov 7, 2024
1 parent 77c94f4 commit ac11837
Show file tree
Hide file tree
Showing 11 changed files with 378 additions and 278 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
identity = CdiUtil.bean(Identity)

if step == 1:
#TODO: this one will change
identity.setWorkingParameter("fido2_assertion_request", "")
return True
elif step == 2:
print "Fido2. Prepare for step 2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
});
}

function getAssertionConditional(request) {
console.log('Get assertion conditional', request);
return navigator.credentials.get({
publicKey: decodePublicKeyCredentialRequestOptions(request),
mediation: "conditional",

});
}

/** Turn a PublicKeyCredential object into a plain object with base64url encoded binary values */
function responseToObject(response) {
Expand All @@ -131,16 +139,27 @@
} catch (e) {
console.error('getClientExtensionResults failed', e);
}

console.log("Response : "+response);
console.log("JSON.stringify: "+ JSON.stringify(response));



if (response.response.attestationObject) {
return {
type: response.type,
id: response.id,
rawId: base64url.fromByteArray(response.rawId),
response: {
attestationObject: base64url.fromByteArray(response.response.attestationObject),
authenticatorData: base64url.fromByteArray(response.response.getAuthenticatorData()),
clientDataJSON: base64url.fromByteArray(response.response.clientDataJSON),
publicKey : base64url.fromByteArray(response.response.getPublicKey()),
publicKeyAlgorithm : response.response.getPublicKeyAlgorithm(),
transports : response.response.getTransports(),
},
clientExtensionResults,
authenticatorAttachment : response.authenticatorAttachment,

};
} else {
return {
Expand All @@ -154,6 +173,7 @@
userHandle: response.response.userHandle && base64url.fromByteArray(response.response.userHandle),
},
clientExtensionResults,
authenticatorAttachment : response.authenticatorAttachment,
};
}
}
Expand Down
Loading

0 comments on commit ac11837

Please sign in to comment.