Skip to content

Commit

Permalink
first stab at new approach for getClientCapabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
timcappalli committed Sep 6, 2023
1 parent 82ec494 commit 633a2da
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,36 @@ Note: Invoking this method from a [=browsing context=] where the [=Web Authentic

</div>

### Availability of [=client=] capabilities - PublicKeyCredential's `getClientCapabilities()` Method ### {#sctn-getClientCapabilities}

<div link-for-hint="WebAuthentication/getClientCapabilities">

[=[WRPS]=] use this method to determine the availability of a limited set of [=WebAuthn Client|client=] capabilities to offer certain workflows and experiences to users. For example, an RP may offer a sign in button on clients where only {{AuthenticatorTransport/hybrid}} transport is available or where {{CredentialMediationRequirement/conditional}} mediation is unavailable (instead of showing a username field).

Upon invocation, the [=client=] employs a [=client platform=]-specific procedure to discover availablity of these capabilities.

This method has no arguments and returns a map of capability keys to boolean values.

<xmp class="idl">
partial interface PublicKeyCredential {
static Promise<GetClientCapabilitiesResult> getClientCapabilities();
};

interface GetClientCapabilitiesResult {
readonly maplike<DOMString, boolean>;
};
</xmp>

Keys in {{GetClientCapabilitiesResult}} SHOULD be members of {{ClientCapability}}.

When the value for a given capability is [TRUE], the feature is known to be currently supported by the client.
When the value for a given capability is [FALSE], the feature is known to be not currently supported by the client.
When a given capability is `undefined`, the availibility of the client feature is not known.

Note: Invoking this method from a [=browsing context=] where the [=Web Authentication API=] is "disabled" according to the [=allowed to use=] algorithm&mdash;i.e., by a [=permissions policy=]&mdash;will result in the promise being rejected with a {{DOMException}} whose name is "{{NotAllowedError}}". See also [[#sctn-permissions-policy]].

</div>

### Deserialize Registration ceremony options - PublicKeyCredential's `parseCreationOptionsFromJSON()` Method ### {#sctn-parseCreationOptionsFromJSON}

<div link-for-hint="WebAuthentication/parseCreationOptionsFromJSON">
Expand Down Expand Up @@ -3944,32 +3974,33 @@ Note: The {{UserVerificationRequirement}} enumeration is deliberately not refere
interest of minimizing disruption to the user interaction flow).
</div>

### Client Capabilities Set (dictionary <dfn dictionary>ClientCapabilities</dfn>) ### {#dictionary-client-capabilities}
### Client Capability Enumeration (enum <dfn enum>ClientCapability</dfn>) ### {#enum-clientCapability}

<xmp class="idl">
dictionary ClientCapabilities {
boolean userVerifyingPlatformAuthenticator;
boolean hybridTransport;
boolean passkeyPlatformAuthenticator;
boolean conditionalMediation;
enum ClientCapability {
"user-verifying-platform-authenticator",
"hybrid-transport,
"passkey-platform-authenticator",
"conditional-mediation"
};
</xmp>

This dictionary defines a limited set of client capabilities which a [=[WRP]=] may evaluate to offer certain workflows and experiences to users.
This enumeration defines a limited set of client capabilities which a [=[WRP]=] may evaluate to offer certain workflows and experiences to users.

<div dfn-type="dict-member" dfn-for="ClientCapabilities">
: <dfn>userVerifyingPlatformAuthenticator</dfn>
Note: The {{ClientCapability}} enumeration is deliberately not referenced, see [[#sct-domstring-backwards-compatibility]].

<div dfn-type="enum-value" dfn-for="ClientCapability">
: <dfn>user-verifying-platform-authenticator</dfn>
:: The [=WebAuthn Client=] supports usage of a [=user-verifying platform authenticator=].

: <dfn>hybridTransport</dfn>
: <dfn>hybrid-transport</dfn>
:: The [=WebAuthn Client=] supports usage of the {{AuthenticatorTransport/hybrid}} transport.

: <dfn>passkeyPlatformAuthenticator</dfn>
: <dfn>passkey-platform-authenticator</dfn>
:: The [=WebAuthn Client=] supports usage of a [=passkey platform authenticator=], locally and/or via {{AuthenticatorTransport/hybrid}} transport.

: <dfn>conditionalMediation</dfn>
: <dfn>conditional-mediation</dfn>
:: The [=WebAuthn Client=] is capable of {{CredentialMediationRequirement/conditional}} mediation.

</div>

## Permissions Policy integration ## {#sctn-permissions-policy}
Expand Down

0 comments on commit 633a2da

Please sign in to comment.