Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/api/admin/passkey/register/options/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ export async function POST(request: NextRequest) {
attestationType: "none",
excludeCredentials,
authenticatorSelection: {
residentKey: "preferred",
residentKey: "required",
requireResidentKey: true,
userVerification: "preferred",
authenticatorAttachment: "platform",
},
supportedAlgorithmIDs: [-7, -257], // ES256, RS256
extensions: { prf: {} } as Parameters<
typeof generateRegistrationOptions
>[0]["extensions"],
Comment on lines 51 to +60
});

// Store challenge in Redis with admin prefix
Expand Down
7 changes: 6 additions & 1 deletion lib/webauthn/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ export function getRegistrationOptions(
attestationType: "none",
excludeCredentials,
authenticatorSelection: {
residentKey: "preferred",
residentKey: "required",
requireResidentKey: true,
userVerification: "preferred",
Comment on lines 24 to 27
authenticatorAttachment: "platform",
},
supportedAlgorithmIDs: [-7, -257], // ES256, RS256
// PRF extension isn't in @simplewebauthn's DOM types yet, but is passed
// through to the client and enables HKDF-based symmetric key derivation
// at authentication time (e.g. for E2EE key wrapping).
extensions: { prf: {} } as GenerateRegistrationOptionsOpts["extensions"],
};
Comment on lines +34 to 35
Comment on lines +31 to 35
}

Expand Down