W3cubDocs

/DOM

PublicKeyCredentialCreationOptions

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: "[email protected]",
            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 compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 67 ? 60 ? ? ?
attestation 67 ? 60 ? ? ?
authenticatorSelection 67 ? 60 ? ? ?
challenge 67 ? 60 ? ? ?
excludeCredentials 67 ? 60 ? ? ?
extensions 67 ? 60 ? ? ?
pubKeyCredParams 67 ? 60 ? ? ?
rp 67 ? 60 ? Yes ?
timeout 67 ? 60 ? ? ?
user 67 ? 60 ? ? ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support ? ? ? ? ? ? ?
attestation ? ? ? ? ? ? ?
authenticatorSelection ? ? ? ? ? ? ?
challenge ? ? ? ? ? ? ?
excludeCredentials ? ? ? ? ? ? ?
extensions ? ? ? ? ? ? ?
pubKeyCredParams ? ? ? ? ? ? ?
rp ? ? ? ? Yes ? ?
timeout ? ? ? ? ? ? ?
user ? ? ? ? ? ? ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions