http
HTTP/1.1 200 OK
Content-Type: text/html
Permissions-Policy: publickey-credentials-create=(self)
<!DOCTYPE html>
<html>
<head><title>Create Account</title></head>
<body>
<button id="register">Register with Passkey</button>
<script>
document.getElementById('register').addEventListener('click', async () => {
const credential = await navigator.credentials.create({
publicKey: {
challenge: new Uint8Array(32),
rp: {name: 'Example Corp', id: 'example.com'},
user: {id: new Uint8Array(16), name: 'user@example.com', displayName: 'User'},
pubKeyCredParams: [{type: 'public-key', alg: -7}]
}
});
// Send credential to server
});
</script>
</body>
</html>