This repository has been archived by the owner on Jan 20, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a125398
commit ed1bad2
Showing
14 changed files
with
102 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: "PasskeyController" | ||
--- | ||
|
||
# `PasskeyController` | ||
|
||
Provides methods for validating WebAuthn attestation and assertion responses for passkeys. Supports ES256 (algorithm id `-7`) and RS256 (algorithm id `-257`). | ||
|
||
## Constructor | ||
|
||
```ts | ||
function constructor(origin: string): this; | ||
``` | ||
|
||
### Parameters | ||
|
||
- `origin`: Where the frontend is hosted (full url) | ||
|
||
## Methods | ||
|
||
- [`validateAssertionResponse()`](/reference/passkey/PasskeyController/validateAssertionResponse) | ||
- [`validateAttestationResponse()`](/reference/passkey/PasskeyController/validateAttestationResponse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
docs/pages/reference/passkey/PasskeyController/validateAttestationResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: "PasskeyController.validateAssertionResponse()" | ||
--- | ||
|
||
# `PasskeyController.validateAttestationResponse()` | ||
|
||
Validates a WebAuthn attestation response, including the signature, but not the attestation certificate. Throws an error on invalid response. | ||
|
||
## Definition | ||
|
||
```ts | ||
//$ WebAuthnAttestationResponse=/reference/passkey/WebAuthnAttestationResponse | ||
function validateAttestationResponse( | ||
response: $$WebAuthnAttestationResponse, | ||
challenge: Uint8Array | ||
): Promise<void>; | ||
``` | ||
|
||
### Parameters | ||
|
||
- `response`: Attestation response | ||
- `challenge`: Challenge used for creating the signature | ||
|
||
## Example | ||
|
||
```ts | ||
//$ WebAuthnAttestationResponse=/reference/passkey/WebAuthnAttestationResponse | ||
//$ passkeyController=/reference/passkey/PasskeyController | ||
try { | ||
const response: $$WebAuthnAttestationResponse = { | ||
clientDataJSON, | ||
authenticatorData | ||
}; | ||
await $$passkeyController.validateAttestationResponse(response, challenge); | ||
} catch { | ||
// failed to validate | ||
} | ||
``` |
6 changes: 3 additions & 3 deletions
6
...s/reference/webauthn/AssertionResponse.md → ...ence/passkey/WebAuthnAssertionResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...reference/webauthn/AttestationResponse.md → ...ce/passkey/WebAuthnAttestationResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: "oslo/passkey" | ||
--- | ||
|
||
# `oslo/passkey` | ||
|
||
Provides utilities for working with passkeys using the Web Authentication API. | ||
|
||
## Classes | ||
|
||
- [`PasskeyController`](/reference/passkey/PasskeyController) | ||
|
||
## Interfaces | ||
|
||
- [`WebAuthnAssertionResponse`](/reference/passkey/WebAuthnAssertionResponse) | ||
- [`WebAuthnAttestationResponse`](/reference/passkey/WebAuthnAttestationResponse) |
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
docs/pages/reference/webauthn/WebAuthnController/validateAttestationResponse.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters