MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-survey

CredentialsContainer.get()

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

The get() method of the CredentialsContainer interface returns a Promise to a Credential instance that matches the provided parameters.

This method is restricted to top-level contexts. Calls to it within an <iframe> element will resolve without effect.

Syntax

var promise = CredentialsContainer.get([options])

Parameters

options Optional
An object that sets options to look for among the credentials in the CredentialsContainer. The available options are:
  • password: a Boolean indicating that returned Credential instances should include user (as opposed to federated) credentials. 
  • federated: An object containing requirements for returned federated credentials. The available options are:
    • providers: An array of DOMString instances of identity providers to search for.
    • protocols An array of DOMString instances of federation protocols to search for.
  • publicKey: An PublicKeyCredentialRequestOptions object containing requirements for returned WebAuthn credentials. 
  • mediation: A String indicating whether the user will be required to log on for every visit to the website. Valid values are "silent", "optional", or "required".
  • unmediated: Boolean indicating the returned Credential instance should not require user mediation.

Returns

Promise that resolves with a Credential instance that matches the provided parameters.

Specifications

Specification Status Comment
Credential Management Level 1
The definition of 'get()' in that specification.
Working Draft Initial definition.
Web Authentication Level 1 Working Draft 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 51 ? ? No support ?
options.mediation 60 ? ? No support ?
WebAuthn support Nightly build Nightly build No support No support No support
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 51 51 ? ? ? No support ?
options.mediation 60 60 ? ? ? No support ?
WebAuthn support No support Nightly build No support No support No support No support No support

Document Tags and Contributors

 Contributors to this page: apowers313, jpmedley, nasearle, rolfedh
 Last updated by: apowers313,