Format and return proper WebAuthn attestation response
Title: Format and return proper WebAuthn attestation response
Description:
Format the signature, public key, and challenge into the correct WebAuthn PublicKeyCredential response structure and return it to the website. This is what the website validates to complete registration.
Acceptance Criteria:
Technical Details:
Location: inject.js (the injected page script)
Build the response object:
const response = {
id: credentialId,
rawId: credentialIdBuffer,
response: {
clientDataJSON: clientDataJSONBuffer,
attestationObject: attestationObjectBuffer
},
type: "public-key"
};
// Return as resolved Promise to replace navigator.credentials.create()
return Promise.resolve(response);
What each field contains:
id: Base64-encoded credentialId (for display)
rawId: Uint8Array of credentialId
clientDataJSON: Encoded challenge + origin + type info
attestationObject: Encoded public key + signature proof
type: Always "public-key"
Implementation Notes:
- Use CBOR encoding for
attestationObject (or use library)
clientDataJSON contains: {"type":"webauthn.create","challenge":"...","origin":"..."}
- Encode challenge as base64url in clientDataJSON
- Include website's origin in clientDataJSON
- Signature proves you own the private key
Testing:
- Load extension
- Visit https://webauthn.io
- Click "Register"
- Check console — response object should be logged
- Website should accept the response and complete registration
Blocked by: Sign the challenge with private key
Blocks: Store passkey metadata in extension storage
Format and return proper WebAuthn attestation response
Title: Format and return proper WebAuthn attestation response
Description:
Format the signature, public key, and challenge into the correct WebAuthn
PublicKeyCredentialresponse structure and return it to the website. This is what the website validates to complete registration.Acceptance Criteria:
inject.jsid,rawId,response.clientDataJSON,response.attestationObjectTechnical Details:
Location:
inject.js(the injected page script)Build the response object:
What each field contains:
id: Base64-encoded credentialId (for display)rawId: Uint8Array of credentialIdclientDataJSON: Encoded challenge + origin + type infoattestationObject: Encoded public key + signature prooftype: Always "public-key"Implementation Notes:
attestationObject(or use library)clientDataJSONcontains:{"type":"webauthn.create","challenge":"...","origin":"..."}Testing:
Blocked by: Sign the challenge with private key
Blocks: Store passkey metadata in extension storage