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 21 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
109 changes: 108 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ spec: SP800-800-63r3; urlPrefix: https://pages.nist.gov/800-63-3/sp800-63-3.html
text: something you have; url: af
text: something you are; url: af

spec: webidl; urlPrefix: https://heycam.github.io/webidl
spec: webidl; urlPrefix: https://webidl.spec.whatwg.org
type: dfn;
text: get a copy of the bytes held by the buffer source; url: dfn-get-buffer-source-copy
text: Exceptions; url: idl-exceptions
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

spec: webdriver; urlPrefix: https://w3c.github.io/webdriver/
type: dfn
Expand Down Expand Up @@ -2251,6 +2252,66 @@ During the above process, the user agent SHOULD show some UI to the user to guid
authorizing an authenticator. When <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}}, prominent modal UI should <i>not</i> be shown <i>unless</i> credential creation was previously consented to via means determined by the user agent.
</div>

#### Create Request Exceptions #### {#sctn-create-request-exceptions}

[INFORMATIVE]

[=[WRPS]=] can encounter a number of exceptions from a call to {{CredentialsContainer/create()|navigator.credentials.create()}}.
Some exceptions can have multiple reasons for why they happened,
requiring the [=[WRPS]=] to infer the actual reason based on their use of WebAuthn.

Note: Exceptions that can be raised during processing of any [=WebAuthn Extensions=],
including ones defined outside of this specification,
are not listed here.

The following {{DOMException}} exceptions can be raised:

<dl>
: {{AbortError}}
:: The ceremony was cancelled by an {{AbortController}}.
See [[#sctn-abortoperation]] and [[#sctn-sample-aborting]].

: {{ConstraintError}}
:: Either {{residentKey}} was set to {{ResidentKeyRequirement/required}} and no available authenticator supported resident keys,
or {{AuthenticatorSelectionCriteria/userVerification}} was set to {{UserVerificationRequirement/required}} and no available authenticator could perform [=user verification=].

: {{InvalidStateError}}
:: The authenticator used in the ceremony recognized an entry in {{PublicKeyCredentialCreationOptions/excludeCredentials}}
after the user [=user consent|consented=] to registering a credential.

: {{NotSupportedError}}
:: No entry in {{PublicKeyCredentialCreationOptions/pubKeyCredParams}} had a {{PublicKeyCredentialDescriptor/type}} property of {{PublicKeyCredentialType/public-key}},
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

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

: {{TimeoutError}}
:: The ceremony was cancelled by the user agent after exceeding the time limit permitted for the ceremony.
See [[#sctn-timeout-recommended-range]] for more information.

: {{UnknownError}}
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
:: The [=authenticator=] could not process the supplied options,
or encountered an error while creating the new credential.
emlun marked this conversation as resolved.
Show resolved Hide resolved

: {{NotAllowedError}}
:: 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>

The following <code>[=Exceptions|Exception=]</code> exceptions can be raised:
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

<dl>

: {{TypeError}}
:: The <code>|options|</code> argument was not a valid [[#sctn-credentialcreationoptions-extension|CredentialCreationOptions]] value,
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
or the value of <code>{{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/id}}</code> was empty or was longer than 64 bytes.

</dl>

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

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

1. Return [TRUE].

#### Get Request Exceptions #### {#sctn-get-request-exceptions}

[INFORMATIVE]

[=[WRPS]=] can encounter a number of exceptions from a call to {{CredentialsContainer/get()|navigator.credentials.get()}}.
Some exceptions can have multiple reasons for why they happened,
requiring the [=[WRPS]=] to infer the actual reason based on their use of WebAuthn.

Note: Exceptions that can be raised during processing of any [=WebAuthn Extensions=],
including ones defined outside of this specification,
are not listed here.

The following {{DOMException}} exceptions can be raised:

<dl>
: {{AbortError}}
:: The ceremony was cancelled by an {{AbortController}}.
See [[#sctn-abortoperation]] and [[#sctn-sample-aborting]].

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

: {{TimeoutError}}
:: The ceremony was cancelled by the user agent after exceeding the time limit permitted for the ceremony.
See [[#sctn-timeout-recommended-range]] for more information.

: {{UnknownError}}
MasterKale marked this conversation as resolved.
Show resolved Hide resolved
:: The [=authenticator=] could not process the supplied options,
or encountered an error while generating an [=assertion signature=].
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

: {{NotAllowedError}}
:: 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

The following <code>[=Exceptions|Exception=]</code> exceptions can be raised:
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

<dl>

: {{TypeError}}
:: The <code>|options|</code> argument was not a valid [[#sctn-credentialrequestoptions-extension|CredentialRequestOptions]] value.
MasterKale marked this conversation as resolved.
Show resolved Hide resolved

</dl>

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

Expand Down