PublicKeyCredentialCreationOptions

Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Properties

PublicKeyCredentialCreationOptions.rp
TBD
PublicKeyCredentialCreationOptions.user
TBD
PublicKeyCredentialCreationOptions.challenge
TBD
PublicKeyCredentialCreationOptions.pubKeyCredParams
array of TBD
PublicKeyCredentialCreationOptions.timeout Optional
TBD
PublicKeyCredentialCreationOptions.excludeCredentials Optional
array of TBD
PublicKeyCredentialCreationOptions.authenticatorSelection Optional
TBD
PublicKeyCredentialCreationOptions.attestation Optional
TBD
PublicKeyCredentialCreationOptions.extensions Optional
dictionary of TBD

Methods

None.

Examples

// some examples of COSE algorithms
const cose_alg_ECDSA_w_SHA256 = -7;
const cose_alg_ECDSA_w_SHA512 = -36;

// the PublicKeyCredentialCreationOptions object
var createCredentialOptions = {

    // Format of new credentials is publicKey
    publicKey: {

        // Relying Party
        rp: {
            name: "Acme",
        },

        // User
        user: {
            id: new Uint8Array(16),
            name: "john.p.smith@example.com",
            displayName: "John P. Smith",
        },

        // Requested format of new keypair
        pubKeyCredParams: [{
            type: "public-key",
            alg: cose_alg_ECDSA_w_SHA256,
        }],

        timeout: 60000 // Timeout after 1 minute
    }
};

// Create the new credential with the options above
navigator.credentials.create(createCredentialOptions);

Specifications

Specification Status Comment
Web Authentication: An API for accessing Public Key Credentials Level 1 Candidate Recommendation Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support Nightly build Nightly build No support No support No support
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support No support No support No support No support No support No support

[1] Web authentication has been restricted to active documents (bug 1409202).

Étiquettes et contributeurs liés au document

Contributeurs à cette page : chrisdavidmills, apowers313
Dernière mise à jour par : chrisdavidmills,