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: "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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support67 ?60 ? ? ?
attestation67 ?60 ? ? ?
authenticatorSelection67 ?60 ? ? ?
challenge67 ?60 ? ? ?
excludeCredentials67 ?60 ? ? ?
extensions67 ?60 ? ? ?
pubKeyCredParams67 ?60 ? ? ?
rp67 ?60 ? Yes ?
timeout67 ?60 ? ? ?
user67 ?60 ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support ? ? ? ? ? ? ?
attestation ? ? ? ? ? ? ?
authenticatorSelection ? ? ? ? ? ? ?
challenge ? ? ? ? ? ? ?
excludeCredentials ? ? ? ? ? ? ?
extensions ? ? ? ? ? ? ?
pubKeyCredParams ? ? ? ? ? ? ?
rp ? ? ? ? Yes ? ?
timeout ? ? ? ? ? ? ?
user ? ? ? ? ? ? ?

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, apowers313
Last updated by: fscholz,