Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help RP's understand actionable exceptions from create() and get() #2047

Merged
merged 29 commits into from
Aug 7, 2024
Merged
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fb8d620
Create a couple new sections in create() and get()
MasterKale Mar 20, 2024
08c5f8d
Document registration exceptions
MasterKale May 1, 2024
8256982
Document authentication exceptions
MasterKale May 1, 2024
a915f42
Merge branch 'main' into 1859-differentiate-errors
MasterKale Jun 5, 2024
eca6907
Incorporate feedback
MasterKale Jun 5, 2024
386a718
Fix manual section IDs
MasterKale Jun 5, 2024
2f82291
Tweak TypeError description
MasterKale Jun 12, 2024
88b2402
Update link to our CredentialCreationOptions
MasterKale Jun 21, 2024
1d5a8d3
Rename section titles
MasterKale Jul 9, 2024
2fb6c02
Clean up PR
MasterKale Jul 9, 2024
6760c57
Mark sections non-normative
MasterKale Jul 9, 2024
4fdf453
Tweak verbiage
MasterKale Jul 9, 2024
6e880f3
Add text about possible external extension errors
MasterKale Jul 9, 2024
6afa223
Add TypeError for .get()
MasterKale Jul 10, 2024
d7f5be3
Merge branch 'main' into 1859-differentiate-errors
MasterKale Jul 11, 2024
ef4e762
Migrate mention of extension exceptions
MasterKale Jul 17, 2024
2159371
Merge branch 'main' into 1859-differentiate-errors
MasterKale Jul 18, 2024
71995bb
Move TypeErrors into separate sections
MasterKale Jul 18, 2024
d62aa75
Change errors -> exceptions
MasterKale Jul 18, 2024
3331b21
Figure out how to link to Exceptions
MasterKale Jul 19, 2024
6d0895e
Punt on summarizing extension exceptions
MasterKale Jul 23, 2024
f15b18b
Use simple exceptions instead
MasterKale Jul 30, 2024
b95ca47
Add SecurityError reasons for related origins
MasterKale Jul 30, 2024
097113a
Remove work from #2095
MasterKale Jul 31, 2024
3e36885
Tweak SecurityError for Related Origins
MasterKale Jul 31, 2024
36dc20c
Incorporate feedback from Emlun
MasterKale Jul 31, 2024
fc52801
Remove superfluous webidl spec reference
MasterKale Jul 31, 2024
419e71f
RPs won't get UnknownError authenticator errors
MasterKale Jul 31, 2024
2b692fa
Wrap types in code tags
MasterKale Jul 31, 2024
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
64 changes: 63 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,45 @@ During the above process, the user agent SHOULD show some UI to the user to guid
authorizing an authenticator.
</div>

#### Registration API Exceptions
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

[=[WRPS]=] can encounter the following {{DOMException|DOMExceptions}} from a call to {{CredentialsContainer/create()|navigator.credentials.create()}}. Some errors can have multiple reasons for why they happened, requiring the [=[WRPS]=] to infer the actual reason based on their use of WebAuthn:
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

<dl dfn-type="argument" dfn-for="Registration API Exceptions">
: <dfn>AbortError</dfn>
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
:: The ceremony was cancelled via an {{AbortController}}
(see [[#sctn-abortoperation]] and [[#sctn-sample-aborting]] for more information.)
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>ConstraintError</dfn>
:: Either {{residentKey}} was set to "{{ResidentKeyRequirement/required}}" and no available authenticator supported resident keys,
or {{userVerification}} was set to "{{UserVerificationRequirement/required}}" and no available authenticator could perform [=user verification=].
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>InvalidStateError</dfn>
:: The authenticator used in the ceremony recognized an entry in {{excludeCredentials}}
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
after the user [=user consent|consented=] to registering a credential.

: <dfn>NotSupportedError</dfn>
:: No entry in {{PublicKeyCredentialCreationOptions/pubKeyCredParams}} had a `type` property of "{{PublicKeyCredentialType/public-key}}",
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
or the [=authenticator=] did not support any of the specified cryptographic parameters in {{PublicKeyCredentialCreationOptions/pubKeyCredParams}}.
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>SecurityError</dfn>
:: The [=effective domain=] was not a [=valid domain=],
or {{PublicKeyCredentialCreationOptions/rp}}.{{PublicKeyCredentialRpEntity/id}} was not a registrable domain suffix of nor was equal to the [=effective domain=].
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>TypeError</dfn>
:: The value of {{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/id}} was not between 1 and 64 bytes (inclusive.)
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>UnknownError</dfn>
:: The [=authenticator=] could not process the supplied options,
or encountered an error while creating the new credential object.
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>{{NotAllowedError}}</dfn>
:: A catch-all error covering a wide range of possible reasons,
including common ones like the user canceling out of the ceremony.
Some of these causes are documented throughout this spec,
while others are client-specific.
emlun marked this conversation as resolved.
Show resolved Hide resolved

emlun marked this conversation as resolved.
Show resolved Hide resolved
</dl>

### Use an Existing Credential to Make an Assertion - PublicKeyCredential's `[[Get]](options)` Method ### {#sctn-getAssertion}

Expand Down Expand Up @@ -2704,6 +2743,29 @@ The steps for [=issuing a credential request to an authenticator=] are as follow

1. Return [TRUE].

#### Authentication API Exceptions
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

[=[WRPS]=] can encounter the following {{DOMException|DOMExceptions}} from a call to {{CredentialsContainer/get()|navigator.credentials.get()}}:

<dl dfn-type="argument" dfn-for="Authentication API Exceptions">
: <dfn>AbortError</dfn>
:: The ceremony was cancelled via an {{AbortController}}
(see [[#sctn-abortoperation]] and [[#sctn-sample-aborting]] for more information.)
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>SecurityError</dfn>
:: The [=effective domain=] was not a [=valid domain=],
or {{PublicKeyCredentialCreationOptions/rp}}.{{PublicKeyCredentialRpEntity/id}} was not a registrable domain suffix of nor was equal to the [=effective domain=].
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: <dfn>UnknownError</dfn>
:: The [=authenticator=] could not process the supplied options,
or encountered an error while generating an [=assertion signature=].

: <dfn>NotAllowedError</dfn>
:: A catch-all error covering a wide range of possible reasons,
including common ones like the user canceling out of the ceremony.
Some of these causes are documented throughout this spec,
while others are client-specific.
emlun marked this conversation as resolved.
Show resolved Hide resolved
</dl>
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

### Store an Existing Credential - PublicKeyCredential's `[[Store]](credential, sameOriginWithAncestors)` Method ### {#sctn-storeCredential}

Expand Down Expand Up @@ -5863,7 +5925,7 @@ The attributes above are structured within this certificate as such:
04 12 -- OCTET STRING
04 10 -- OCTET STRING
CD 8C 39 5C 26 ED EE DE -- AAGUID cd8c395c-26ed-eede-653b-00797d03ca3c
65 3B 00 79 7D 03 CA 3C
65 3B 00 79 7D 03 CA 3C
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

30 12 -- SEQUENCE
06 0B 2B 06 01 04 01 82 E5 1C 01 01 05 -- OID 1.3.6.1.4.1.45724.1.1.5
Expand Down